<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>122382</bug_id>
          
          <creation_ts>2006-02-20 22:49:12 +0000</creation_ts>
          <short_desc>labels&apos; context menu&apos;s &quot;size&quot; doesn&apos;t work and isn&apos;t what it should be</short_desc>
          <delta_ts>2006-02-23 22:19:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kig</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Stefan Monov">logixoul</reporter>
          <assigned_to name="Pino Toscano">pino</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>415930</commentid>
    <comment_count>0</comment_count>
    <who name="Stefan Monov">logixoul</who>
    <bug_when>2006-02-20 22:49:12 +0000</bug_when>
    <thetext>Version:           v0.10.5 (using KDE 3.5.1 Level &quot;a&quot; , SUSE 10.0 UNSUPPORTED)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.8-default

In the context menu of labels, the &quot;Size&quot; submenu should be used for setting the font size. Right now it&apos;s does nothing and is the same as for a line.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>416810</commentid>
    <comment_count>1</comment_count>
    <who name="Pino Toscano">pino</who>
    <bug_when>2006-02-23 22:19:26 +0000</bug_when>
    <thetext>SVN commit 512879 by pino:

Do not show the Style and the Size submenus in the object popup if the selection
contains only labels.
CCBUGS: 122381, 122382


 M  +15 -3     popup.cc  
 M  +5 -0      popup.h  


--- branches/KDE/3.5/kdeedu/kig/modes/popup.cc #512878:512879
@@ -33,6 +33,7 @@
 #include &quot;../objects/other_type.h&quot;
 #include &quot;../objects/object_factory.h&quot;
 #include &quot;../objects/polygon_imp.h&quot;
+#include &quot;../objects/text_imp.h&quot;
 #include &quot;../misc/lists.h&quot;
 #include &quot;../misc/argsparser.h&quot;
 #include &quot;../misc/kigpainter.h&quot;
@@ -184,7 +185,7 @@
                                                 const std::vector&lt;ObjectHolder*&gt;&amp; objs,
 						const QPoint&amp; plc )
   : KPopupMenu( &amp;view ), mplc( plc ), mpart( part ), mview( view ), mobjs( objs ),
-    mmode( mode )
+    mmode( mode ), monlylabels( false )
 {
   bool empty = objs.empty();
   bool single = objs.size() == 1;
@@ -204,6 +205,17 @@
     title = i18n( &quot;%1 Objects&quot; ).arg( objs.size() );
   insertTitle( title, 1 );
 
+  if ( !empty )
+  {
+    monlylabels = true;
+    uint i = 0;
+    while ( i &lt; objs.size() &amp;&amp; monlylabels )
+    {
+      monlylabels &amp;= objs[i]-&gt;imp()-&gt;inherits( TextImp::stype() );
+      ++i;
+    }
+  }
+
   if ( empty )
   {
     // provides some diverse stuff like &quot;unhide all&quot;, set coordinate
@@ -399,7 +411,7 @@
     }
     popup.addAction( menu, i18n( &quot;&amp;Custom Color&quot; ), nextfree++ );
   }
-  else if ( menu == NormalModePopupObjects::SetSizeMenu )
+  else if ( menu == NormalModePopupObjects::SetSizeMenu &amp;&amp; !popup.onlyLabels() )
   {
     bool point = true;
     bool samecolor = true;
@@ -434,7 +446,7 @@
       popup.addAction( menu, p, nextfree++ );
     };
   }
-  else if ( menu == NormalModePopupObjects::SetStyleMenu )
+  else if ( menu == NormalModePopupObjects::SetStyleMenu &amp;&amp; !popup.onlyLabels() )
   {
     bool samecolor = true;
     int npoints = 0;
--- branches/KDE/3.5/kdeedu/kig/modes/popup.h #512878:512879
@@ -75,6 +75,8 @@
   KigWidget&amp; widget() { return mview; };
   QPoint plc() { return mplc; };
 
+  bool onlyLabels() const { return monlylabels; };
+
 protected:
   void activateAction( int menu, int action );
 
@@ -100,6 +102,9 @@
   std::vector&lt;PopupActionProvider*&gt; mproviders;
 
   QPopupMenu* mmenus[NumberOfMenus];
+
+private:
+  bool monlylabels;
 };
 
 /**
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>416811</commentid>
    <comment_count>2</comment_count>
    <who name="Pino Toscano">pino</who>
    <bug_when>2006-02-23 22:19:48 +0000</bug_when>
    <thetext>SVN commit 512881 by pino:

Do not show the Style and the Size submenus in the object popup if the selection
contains only labels.
BUGS: 122381, 122382


 M  +15 -3     popup.cc  
 M  +5 -0      popup.h  


--- trunk/KDE/kdeedu/kig/modes/popup.cc #512880:512881
@@ -33,6 +33,7 @@
 #include &quot;../objects/other_type.h&quot;
 #include &quot;../objects/object_factory.h&quot;
 #include &quot;../objects/polygon_imp.h&quot;
+#include &quot;../objects/text_imp.h&quot;
 #include &quot;../objects/text_type.h&quot;
 #include &quot;../misc/lists.h&quot;
 #include &quot;../misc/argsparser.h&quot;
@@ -186,7 +187,7 @@
                                                 const std::vector&lt;ObjectHolder*&gt;&amp; objs,
                                                 const QPoint&amp; plc )
   : KMenu( &amp;view ), mplc( plc ), mpart( part ), mview( view ), mobjs( objs ),
-    mmode( mode )
+    mmode( mode ), monlylabels( false )
 {
   bool empty = objs.empty();
   bool single = objs.size() == 1;
@@ -205,6 +206,17 @@
     title = i18n( &quot;%1 Objects&quot; ).arg( objs.size() );
   addTitle( title );
 
+  if ( !empty )
+  {
+    monlylabels = true;
+    uint i = 0;
+    while ( i &lt; objs.size() &amp;&amp; monlylabels )
+    {
+      monlylabels &amp;= objs[i]-&gt;imp()-&gt;inherits( TextImp::stype() );
+      ++i;
+    }
+  }
+
   if ( empty )
   {
     // provides some diverse stuff like &quot;unhide all&quot;, set coordinate
@@ -378,7 +390,7 @@
     QPixmap icon = l-&gt;loadIcon( &quot;colorize&quot;, KIcon::Small, 22, KIcon::DefaultState, 0L, true );
     popup.addInternalAction( menu, icon, i18n( &quot;&amp;Custom Color&quot; ), nextfree++ );
   }
-  else if ( menu == NormalModePopupObjects::SetSizeMenu )
+  else if ( menu == NormalModePopupObjects::SetSizeMenu &amp;&amp; !popup.onlyLabels() )
   {
     bool point = true;
     bool samecolor = true;
@@ -413,7 +425,7 @@
       popup.addInternalAction( menu, p, nextfree++ );
     };
   }
-  else if ( menu == NormalModePopupObjects::SetStyleMenu )
+  else if ( menu == NormalModePopupObjects::SetStyleMenu &amp;&amp; !popup.onlyLabels() )
   {
     bool samecolor = true;
     int npoints = 0;
--- trunk/KDE/kdeedu/kig/modes/popup.h #512880:512881
@@ -73,6 +73,8 @@
   KigWidget&amp; widget() { return mview; };
   QPoint plc() { return mplc; };
 
+  bool onlyLabels() const { return monlylabels; };
+
 protected:
   void activateAction( int menu, int action );
 
@@ -89,6 +91,9 @@
   std::vector&lt;PopupActionProvider*&gt; mproviders;
 
   QMenu* mmenus[NumberOfMenus];
+
+private:
+  bool monlylabels;
 };
 
 /**
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>416814</commentid>
    <comment_count>3</comment_count>
    <who name="Pino Toscano">pino</who>
    <bug_when>2006-02-23 22:19:58 +0000</bug_when>
    <thetext>SVN commit 512880 by pino:

Do not show the Style and the Size submenus in the object popup if the selection
contains only labels.
CCBUGS: 122381, 122382


 M  +15 -3     popup.cc  
 M  +5 -0      popup.h  


--- branches/kig/post-kde-3.5/kig/modes/popup.cc #512879:512880
@@ -33,6 +33,7 @@
 #include &quot;../objects/other_type.h&quot;
 #include &quot;../objects/object_factory.h&quot;
 #include &quot;../objects/polygon_imp.h&quot;
+#include &quot;../objects/text_imp.h&quot;
 #include &quot;../objects/text_type.h&quot;
 #include &quot;../misc/lists.h&quot;
 #include &quot;../misc/argsparser.h&quot;
@@ -186,7 +187,7 @@
                                                 const std::vector&lt;ObjectHolder*&gt;&amp; objs,
 						const QPoint&amp; plc )
   : KPopupMenu( &amp;view ), mplc( plc ), mpart( part ), mview( view ), mobjs( objs ),
-    mmode( mode )
+    mmode( mode ), monlylabels( false )
 {
   bool empty = objs.empty();
   bool single = objs.size() == 1;
@@ -206,6 +207,17 @@
     title = i18n( &quot;%1 Objects&quot; ).arg( objs.size() );
   insertTitle( title, 1 );
 
+  if ( !empty )
+  {
+    monlylabels = true;
+    uint i = 0;
+    while ( i &lt; objs.size() &amp;&amp; monlylabels )
+    {
+      monlylabels &amp;= objs[i]-&gt;imp()-&gt;inherits( TextImp::stype() );
+      ++i;
+    }
+  }
+
   if ( empty )
   {
     // provides some diverse stuff like &quot;unhide all&quot;, set coordinate
@@ -401,7 +413,7 @@
     }
     popup.addAction( menu, i18n( &quot;&amp;Custom Color&quot; ), nextfree++ );
   }
-  else if ( menu == NormalModePopupObjects::SetSizeMenu )
+  else if ( menu == NormalModePopupObjects::SetSizeMenu &amp;&amp; !popup.onlyLabels() )
   {
     bool point = true;
     bool samecolor = true;
@@ -436,7 +448,7 @@
       popup.addAction( menu, p, nextfree++ );
     };
   }
-  else if ( menu == NormalModePopupObjects::SetStyleMenu )
+  else if ( menu == NormalModePopupObjects::SetStyleMenu &amp;&amp; !popup.onlyLabels() )
   {
     bool samecolor = true;
     int npoints = 0;
--- branches/kig/post-kde-3.5/kig/modes/popup.h #512879:512880
@@ -75,6 +75,8 @@
   KigWidget&amp; widget() { return mview; };
   QPoint plc() { return mplc; };
 
+  bool onlyLabels() const { return monlylabels; };
+
 protected:
   void activateAction( int menu, int action );
 
@@ -100,6 +102,9 @@
   std::vector&lt;PopupActionProvider*&gt; mproviders;
 
   QPopupMenu* mmenus[NumberOfMenus];
+
+private:
+  bool monlylabels;
 };
 
 /**
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>