kdeadmin (4:4.4.5-4) 05_system_config_printer_kde_scroll_printer_options.diff

Summary

 system-config-printer-kde/system-config-printer-kde.py |    7 ++
 system-config-printer-kde/system-config-printer.ui     |   46 +++++++++--------
 2 files changed, 33 insertions(+), 20 deletions(-)

    
download this patch

Patch contents

From: Modestas Vainius <modax@debian.org>
Subject: Fix size problems of the system-config-printer-kde Printer Properties dialog
Forwarded: no
Origin: vendor
Last-Update: 2010-09-17

Without this patch, whenever system-config-printer-kde printer Properties
dialog was opened, it (or its container, i.e. System Settings) would be
stretched vertically to accommodate the size of the likely huge "Options" tab.
This patch fixes the problem by putting the contents of problematic "Options"
tab into QScrollArea widget (like it is already done with "Job Options" tab).
The patch also makes sure that QScrollArea's of both "Options" and "Job
Options" tabs are wide enough and initially do not need a horizontal scroll
bar.
--- a/system-config-printer-kde/system-config-printer-kde.py
+++ b/system-config-printer-kde/system-config-printer-kde.py
@@ -376,6 +376,11 @@ class GUI(QWidget):
         self.ui.lblPOptions.hide()
         self.ui.lblPInstallOptions.hide()
 
+        # Enforce minimumSize of Job Options scroll area viewport in
+        # order for the scroll area widget to fit horizontally
+        self.ui.scrollArea.viewport().setMinimumSize( \
+          self.ui.scrollArea.widget().minimumSizeHint().width(), 0)
+
         return self.ui
 
     # now called  dests_iconview_item_activated() in the Gnome version
@@ -1321,6 +1326,8 @@ class GUI(QWidget):
         self.swPInstallOptions.show_all()
         self.swPOptions.show_all()
         """
+        self.ui.optionsPageScrollArea.viewport().setMinimumSize( \
+          self.ui.optionsPageScrollArea.widget().minimumSizeHint().width(), 0)
 
 
     # Class members
--- a/system-config-printer-kde/system-config-printer.ui
+++ b/system-config-printer-kde/system-config-printer.ui
@@ -548,7 +548,7 @@ print to.</string>
                <item>
                 <widget class="QLabel" name="lblNotPublished">
                  <property name="text">
-                  <string comment="KDE::DoNotExtract" >TextLabel</string>
+                  <string comment="KDE::DoNotExtract">TextLabel</string>
                  </property>
                 </widget>
                </item>
@@ -865,26 +865,29 @@ print to.</string>
             </attribute>
             <layout class="QVBoxLayout" name="verticalLayout_3">
              <item>
-              <widget class="QWidget" name="optionsPageWidget" native="true">
-               <layout class="QGridLayout" name="gridLayout_5">
-                <item row="0" column="0">
-                 <layout class="QVBoxLayout" name="vbPOptions"/>
-                </item>
-               </layout>
-              </widget>
-             </item>
-             <item>
-              <spacer name="verticalSpacer">
-               <property name="orientation">
-                <enum>Qt::Vertical</enum>
+              <widget class="QScrollArea" name="optionsPageScrollArea">
+               <property name="frameShape">
+                <enum>QFrame::NoFrame</enum>
                </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>20</width>
-                 <height>531</height>
-                </size>
+               <property name="widgetResizable">
+                <bool>true</bool>
                </property>
-              </spacer>
+               <widget class="QWidget" name="optionsPageWidget">
+                <property name="geometry">
+                 <rect>
+                  <x>0</x>
+                  <y>0</y>
+                  <width>532</width>
+                  <height>426</height>
+                 </rect>
+                </property>
+                <layout class="QGridLayout" name="gridLayout_5">
+                 <item row="0" column="0">
+                  <layout class="QVBoxLayout" name="vbPOptions"/>
+                 </item>
+                </layout>
+               </widget>
+              </widget>
              </item>
             </layout>
            </widget>
@@ -895,6 +898,9 @@ print to.</string>
             <layout class="QGridLayout" name="gridLayout_9">
              <item row="0" column="0">
               <widget class="QScrollArea" name="scrollArea">
+               <property name="frameShape">
+                <enum>QFrame::NoFrame</enum>
+               </property>
                <property name="verticalScrollBarPolicy">
                 <enum>Qt::ScrollBarAlwaysOn</enum>
                </property>
@@ -906,7 +912,7 @@ print to.</string>
                  <rect>
                   <x>0</x>
                   <y>0</y>
-                  <width>509</width>
+                  <width>514</width>
                   <height>1026</height>
                  </rect>
                 </property>