<?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>273723</bug_id>
          
          <creation_ts>2011-05-20 13:56:48 +0000</creation_ts>
          <short_desc>KConfigDialog::addPage() requires hardcoded icon sizes</short_desc>
          <delta_ts>2011-05-23 09:14:12 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kdelibs</product>
          <component>kdeui</component>
          <version>unspecified</version>
          <rep_platform>Unlisted Binaries</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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="Lukas Sommer">sommerluk</reporter>
          <assigned_to name="kdelibs bugs">kdelibs-bugs-null</assigned_to>
          <cc>pino</cc>
          
          <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>1121245</commentid>
    <comment_count>0</comment_count>
    <who name="Lukas Sommer">sommerluk</who>
    <bug_when>2011-05-20 13:56:48 +0000</bug_when>
    <thetext>Version:           unspecified (using Devel) 
OS:                Linux

KConfigDialog manages various pages and displays at the left of the dialog a list of the pages, which can contain a text and an icon for each page.


Reproducible: Always

Steps to Reproduce:
Use KConfigDialog::addPage() to add a new page.


Actual Results:  
KConfigDialog::addPage() only accepts &quot;const QString &amp;pixmapName&quot; to determine the icon that is displayed. To use a simple standard icon, you have to so something like

KIconLoader iconloader;
addPage(new settings_general_widget_saving(this),
        i18nc(&quot;@title of a page in the configuration dialog&quot;, &quot;Saving&quot;),
        iconloader.iconPath(&quot;document-save&quot;, KIconLoader::SizeEnormous * (-1)));

This is not very practical. And above all you have to use a hardcoded icon size. Icon sizes should not be hardcoded, but they should be managed by the kdeui library.



Expected Results:  
KConfigDialog::addPage() has overloaded functions that accept KIcon (or QIcon?) instead of the path to the icon file.

The icon size is not hardcoded but determined by the kdeui library (like it is done for the icons in the toolbar) or by the widget style. (Would this be possible with QStyle? Some widget styles like &quot;Skulpture&quot; resize the icons in Buttons and Menus!)



This is a spin-off bug of Bug 272266

The default icon size should be DPI sensitive. Maybe it could depend on QStyle/KStyle?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1121336</commentid>
    <comment_count>1</comment_count>
    <who name="Pino Toscano">pino</who>
    <bug_when>2011-05-20 18:42:44 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; KConfigDialog::addPage() only accepts &quot;const QString &amp;pixmapName&quot; to determine
&gt; the icon that is displayed. To use a simple standard icon, you have to so
&gt; something like
&gt; 
&gt; KIconLoader iconloader;
&gt; addPage(new settings_general_widget_saving(this),
&gt;         i18nc(&quot;@title of a page in the configuration dialog&quot;, &quot;Saving&quot;),
&gt;         iconloader.iconPath(&quot;document-save&quot;, KIconLoader::SizeEnormous *
&gt; (-1)));

No that&apos;s wrong, &quot;pixmapName&quot; means the name of an icon in the current icon theme.
Just one example of the okular sources:

    addPage( m_general, i18n(&quot;General&quot;), &quot;okular&quot;, i18n(&quot;General Options&quot;) );

(Oh, and a side note: creating a new KIconLoader is not the best idea, just use the global one you have at KIconLoader::global().)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1121354</commentid>
    <comment_count>2</comment_count>
    <who name="Lukas Sommer">sommerluk</who>
    <bug_when>2011-05-20 19:43:04 +0000</bug_when>
    <thetext>Shame on me. I didn&apos;t even notice that it was possible to pass just the icon name. (I&apos;ve yet changed the corresponding code in KStreamRipper, the program from which was taken the code example.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1121570</commentid>
    <comment_count>3</comment_count>
    <who name="Lukas Sommer">sommerluk</who>
    <bug_when>2011-05-21 12:34:45 +0000</bug_when>
    <thetext>I&apos;ve made a patch that fixes the documentation:

http://git.reviewboard.kde.org/r/101409/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1122167</commentid>
    <comment_count>4</comment_count>
    <who name="Lukas Sommer">sommerluk</who>
    <bug_when>2011-05-23 09:14:12 +0000</bug_when>
    <thetext>Closing as INVALID because the requested behaviour exists yet.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>