|
From: CVS C. to T. <the...@li...> - 2016-05-02 19:49:01
|
Revision: 730
http://sourceforge.net/p/themis/code/730
Author: mark_hellegers
Date: 2016-05-02 19:49:00 +0000 (Mon, 02 May 2016)
Log Message:
-----------
Make the BMenuFields in the preferences look a bit nicer
Modified Paths:
--------------
trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp
trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp
Modified: trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp
===================================================================
--- trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp 2016-03-05 16:43:45 UTC (rev 729)
+++ trunk/themis/modules/CSSParser/CSSParserPrefsView.cpp 2016-05-02 19:49:00 UTC (rev 730)
@@ -117,6 +117,17 @@
rect.InsetBy(kItemSpacing, kItemSpacing);
rect.top += kBBoxExtraInset;
+#ifndef __HAIKU__
+ // ResizeToPreferred of a BMenuField is broken on BeOS,
+ // so we do something ourselves
+ font_height height;
+ GetFontHeight(&height);
+ // Set the menu height to the font height + a number of pixels
+ // around the text.
+ float menuHeight = height.ascent + height.descent + height.leading + 6;
+ rect.bottom = rect.top + menuHeight;
+#endif
+
BMenuField* cssmenufield = new BMenuField(
rect,
"CSSFIELD", "Cascading Style Sheet:",
@@ -124,6 +135,11 @@
true,
B_FOLLOW_TOP,
B_WILL_DRAW);
+#ifdef __HAIKU__
+ // We can use the normal way to resize the BMenuField to the right size
+ // on Haiku
+ cssmenufield->ResizeToPreferred();
+#endif
cssmenufield->SetDivider(be_plain_font->StringWidth("Cascading Style Sheet:") + kItemSpacing);
mMainBox->AddChild(cssmenufield);
Modified: trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp
===================================================================
--- trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp 2016-03-05 16:43:45 UTC (rev 729)
+++ trunk/themis/modules/HTMLParser/HTMLParserPrefsView.cpp 2016-05-02 19:49:00 UTC (rev 730)
@@ -118,6 +118,17 @@
BRect rect = mMainBox->Bounds();
rect.InsetBy(kItemSpacing, kItemSpacing);
rect.top += kBBoxExtraInset;
+
+#ifndef __HAIKU__
+ // ResizeToPreferred of a BMenuField is broken on BeOS,
+ // so we do something ourselves
+ font_height height;
+ GetFontHeight(&height);
+ // Set the menu height to the font height + a number of pixels
+ // around the text.
+ float menuHeight = height.ascent + height.descent + height.leading + 6;
+ rect.bottom = rect.top + menuHeight;
+#endif
BMenuField* dtdmenufield = new BMenuField(
rect,
@@ -126,6 +137,12 @@
true,
B_FOLLOW_TOP,
B_WILL_DRAW);
+
+#ifdef __HAIKU__
+ // We can use the normal way to resize the BMenuField to the right size
+ // on Haiku
+ dtdmenufield->ResizeToPreferred();
+#endif
dtdmenufield->SetDivider(be_plain_font->StringWidth("Document Type Definition:") + kItemSpacing);
mMainBox->AddChild(dtdmenufield);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|