[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: [patch] minicli resizeable
From: Martin Koller <m.koller () surfeu ! at>
Date: 2005-09-04 13:50:20
Message-ID: 200509041550.24529.m.koller () surfeu ! at
[Download RAW message or body]
[Attachment #2 (multipart/mixed)]
Hi,
I try again to offer a patch (3.5) which allows minicli to be resizeable -
without the problem of an ever growing combobox.
(https://bugs.kde.org/show_bug.cgi?id=112020)
I work with this patch now for almost a year (applied locally again and
again ...) without problems.
Are there good reasons to not allow this in ?
--
Best regards/Schöne Grüße
Martin () ascii ribbon campaign - against html mail
/\ - against microsoft attachments
Some operating systems are called 'user friendly',
Linux however is 'expert friendly'.
["minicli.patch" (text/x-diff)]
Index: minicli_ui.ui
===================================================================
--- minicli_ui.ui (revision 456956)
+++ minicli_ui.ui (working copy)
@@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>MinicliDlgUI</class>
<widget class="QWidget">
<property name="name">
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>325</width>
- <height>370</height>
+ <width>493</width>
+ <height>378</height>
</rect>
</property>
<property name="sizePolicy">
@@ -24,6 +24,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
+ <property name="resizeMode">
+ <enum>FreeResize</enum>
+ </property>
<widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>layout4</cstring>
@@ -56,11 +59,11 @@
<enum>Horizontal</enum>
</property>
<property name="sizeType">
- <enum>MinimumExpanding</enum>
+ <enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
- <width>80</width>
+ <width>250</width>
<height>20</height>
</size>
</property>
@@ -118,7 +121,7 @@
<enum>Horizontal</enum>
</property>
<property name="sizeType">
- <enum>Minimum</enum>
+ <enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
@@ -211,7 +214,7 @@
</property>
<property name="sizePolicy">
<sizepolicy>
- <hsizetype>7</hsizetype>
+ <hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>5</horstretch>
<verstretch>0</verstretch>
@@ -321,7 +324,7 @@
</property>
<property name="sizePolicy">
<sizepolicy>
- <hsizetype>7</hsizetype>
+ <hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>5</horstretch>
<verstretch>0</verstretch>
@@ -382,7 +385,7 @@
</property>
<property name="sizePolicy">
<sizepolicy>
- <hsizetype>7</hsizetype>
+ <hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
@@ -455,6 +458,14 @@
<property name="name">
<cstring>lbCommand</cstring>
</property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string>Com&mand:</string>
</property>
@@ -469,6 +480,14 @@
<property name="name">
<cstring>lbRunIcon</cstring>
</property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text">
<string></string>
</property>
@@ -488,6 +507,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="minimumSize">
+ <size>
+ <width>388</width>
+ <height>0</height>
+ </size>
+ </property>
<property name="whatsThis" stdset="0">
<string>Enter the command you wish to execute or the address of the \
resource you want to open. This can be a remote URL like "www.kde.org" or a local one \
like "~/.kderc".</string> </property>
@@ -513,6 +538,8 @@
</widget>
</grid>
</widget>
+<customwidgets>
+</customwidgets>
<connections>
<connection>
<sender>cbPriority</sender>
@@ -592,8 +619,6 @@
<includehint>kpushbutton.h</includehint>
<includehint>kpushbutton.h</includehint>
<includehint>kpassdlg.h</includehint>
- <includehint>klineedit.h</includehint>
<includehint>kcombobox.h</includehint>
- <includehint>klineedit.h</includehint>
</includehints>
</UI>
Index: minicli.cpp
===================================================================
--- minicli.cpp (revision 456956)
+++ minicli.cpp (working copy)
@@ -121,8 +121,6 @@
m_dlg->leUsername->setText("root");
- setMaxCommandBoxWidth();
-
// Main widget buttons...
connect( m_dlg->pbRun, SIGNAL(clicked()), this, SLOT(accept()) );
connect( m_dlg->pbCancel, SIGNAL(clicked()), this, SLOT(reject()) );
@@ -163,9 +161,9 @@
}
}
-void Minicli::setMaxCommandBoxWidth()
+QSize Minicli::sizeHint() const
{
- int maxWidth = qApp->desktop()->screenGeometry(this).width();
+ int maxWidth = qApp->desktop()->screenGeometry((QWidget*)this).width();
if (maxWidth < 603)
{
// a sensible max for smaller screens
@@ -176,19 +174,13 @@
maxWidth = maxWidth * 2 / 5;
}
- m_dlg->cbCommand->setMaximumWidth(maxWidth);
+ return QSize(maxWidth, -1);
}
void Minicli::show()
{
- setMaxCommandBoxWidth();
KWin::setState( winId(), NET::StaysOnTop );
- setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
- adjustSize();
- setFixedSize(size());
KDialog::show();
- adjustSize();
- setFixedSize(size());
}
void Minicli::loadConfig()
@@ -879,9 +871,7 @@
void Minicli::fontChange( const QFont & )
{
- setMaxCommandBoxWidth();
adjustSize();
- setFixedSize(size());
}
// vim: set et ts=2 sts=2 sw=2:
Index: minicli.h
===================================================================
--- minicli.h (revision 456956)
+++ minicli.h (working copy)
@@ -56,6 +56,7 @@
void clearHistory();
virtual void show();
+ virtual QSize sizeHint() const;
protected slots:
virtual void accept();
@@ -83,7 +84,6 @@
int runCommand();
void parseLine( bool final );
QString terminalCommand (const QString&, const QString&);
- void setMaxCommandBoxWidth();
QString calculate(const QString &exp);
void notifyServiceStarted(KService::Ptr service);
[Attachment #6 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic