[rkward-cvs] SF.net SVN: rkward: [898] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Sun Oct 22 17:38:35 UTC 2006
Revision: 898
http://svn.sourceforge.net/rkward/?rev=898&view=rev
Author: tfry
Date: 2006-10-22 10:38:28 -0700 (Sun, 22 Oct 2006)
Log Message:
-----------
Size RKInput depending on font metrics. Make sure not to show scollbars in small and medium modes
Modified Paths:
--------------
trunk/rkward/ChangeLog
trunk/rkward/rkward/plugin/rkinput.cpp
Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog 2006-10-22 17:18:55 UTC (rev 897)
+++ trunk/rkward/ChangeLog 2006-10-22 17:38:28 UTC (rev 898)
@@ -1,3 +1,4 @@
+- fix to plugin input lines sizing, and visibility of scrollbars
- on startup, show window maximized if not size stored (i.e. very first startup)
- prevent infinite recursion when parsing structure of environments
- fix for compilation on 64bit architectures
Modified: trunk/rkward/rkward/plugin/rkinput.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkinput.cpp 2006-10-22 17:18:55 UTC (rev 897)
+++ trunk/rkward/rkward/plugin/rkinput.cpp 2006-10-22 17:38:28 UTC (rev 898)
@@ -45,12 +45,18 @@
textedit = new QTextEdit (this);
int size = xml->getMultiChoiceAttribute (element, "size", "small;medium;large", 1, DL_INFO);
+ int lheight = textedit->fontMetrics ().lineSpacing ();
+ int margin = textedit->height () - textedit->visibleHeight () + textedit->fontMetrics ().descent () + 2;
if (size == 0) {
- textedit->setFixedSize (100, 25);
+ textedit->setFixedSize (100, lheight + margin);
+ textedit->setHScrollBarMode (QScrollView::AlwaysOff);
+ textedit->setVScrollBarMode (QScrollView::AlwaysOff);
} else if (size == 1) {
- textedit->setFixedSize (250, 25);
+ textedit->setFixedSize (250, lheight + margin);
+ textedit->setHScrollBarMode (QScrollView::AlwaysOff);
+ textedit->setVScrollBarMode (QScrollView::AlwaysOff);
} else if (size == 2) {
- textedit->setMinimumSize (250, 100);
+ textedit->setMinimumSize (250, lheight * 4 + margin);
}
vbox->addWidget (textedit);
connect (textedit, SIGNAL (textChanged ()), SLOT (textChanged ()));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list