summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-01-14 09:30:13 -0600
committerTimothy Pearson <[email protected]>2013-01-14 09:30:13 -0600
commitc36c1233642e3bc6f35547453e2832da8afcbd86 (patch)
tree2b5211d8723cf8bcceda8c513356361846eebb08
parent4a9ef2722b9e89206708b5889838ff8541badaab (diff)
downloadgtk3-tqt-engine-c36c1233642e3bc6f35547453e2832da8afcbd86.tar.gz
gtk3-tqt-engine-c36c1233642e3bc6f35547453e2832da8afcbd86.zip
Fix checkbox drawing
Draw frame backgrounds
-rw-r--r--tdegtk/tdegtk-draw.cpp9
-rw-r--r--tdegtk/tdegtk-theme.cpp10
2 files changed, 12 insertions, 7 deletions
diff --git a/tdegtk/tdegtk-draw.cpp b/tdegtk/tdegtk-draw.cpp
index 8767c5f..60f90ed 100644
--- a/tdegtk/tdegtk-draw.cpp
+++ b/tdegtk/tdegtk-draw.cpp
@@ -152,8 +152,12 @@ static TQStyle::SFlags gtkToTQtStyleFlags(GtkThemingEngine* engine, GtkStateFlag
}
}
if (mousedown) {
- sflags |= TQStyle::Style_On;
- if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkButton))) {
+ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkButton))) {
+ sflags |= TQStyle::Style_On;
+ sflags |= TQStyle::Style_Down;
+ }
+ else {
+ sflags |= TQStyle::Style_Off;
sflags |= TQStyle::Style_Down;
}
}
@@ -1684,6 +1688,7 @@ tdegtk_draw_common_background (DRAW_ARGS)
|| (gtk_widget_path_is_type(path, GTK_TYPE_VIEWPORT))
|| (gtk_widget_path_is_type(path, GTK_TYPE_SCROLLED_WINDOW))
|| (gtk_widget_path_is_type(path, GTK_TYPE_PANED))
+ || (gtk_widget_path_is_type(path, GTK_TYPE_FRAME))
) {
TQStringList objectTypes;
objectTypes.append(TQWIDGET_OBJECT_NAME_STRING);
diff --git a/tdegtk/tdegtk-theme.cpp b/tdegtk/tdegtk-theme.cpp
index 422aa15..e4db7b3 100644
--- a/tdegtk/tdegtk-theme.cpp
+++ b/tdegtk/tdegtk-theme.cpp
@@ -978,18 +978,18 @@ void writeGtkThemeControlFile(int forceRecreate) {
ceData.widgetObjectTypes = objectTypes;
ceData.orientation = TQt::Horizontal;
+ TQSize sz;
TQMenuItem tqt3MenuItem;
+
tqt3MenuItem.setSeparator(false);
tdeStandardMenuItemHeight = TQPopupMenu::menuItemHeight(&tqt3MenuItem, tqApp->fontMetrics());
- tqt3MenuItem.setSeparator(true);
- tdeSeparatorMenuItemHeight = TQPopupMenu::menuItemHeight(&tqt3MenuItem, tqApp->fontMetrics());
-
- TQSize sz;
ceData.rect = TQRect(0, 0, 0, tdeStandardMenuItemHeight);
sz = tqApp->style().sizeFromContents(TQStyle::CT_PopupMenuItem, ceData, elementFlags, TQSize(0, tdeStandardMenuItemHeight), TQStyleOption(&tqt3MenuItem));
sz = sz.expandedTo(TQSize(0, sz.height()));
tdeStandardMenuItemHeight = sz.height();
+ tqt3MenuItem.setSeparator(true);
+ tdeSeparatorMenuItemHeight = TQPopupMenu::menuItemHeight(&tqt3MenuItem, tqApp->fontMetrics());
ceData.rect = TQRect(0, 0, 0, tdeSeparatorMenuItemHeight);
sz = tqApp->style().sizeFromContents(TQStyle::CT_PopupMenuItem, ceData, elementFlags, TQSize(0, tdeSeparatorMenuItemHeight), TQStyleOption(&tqt3MenuItem));
sz = sz.expandedTo(TQSize(0, sz.height()));
@@ -1009,7 +1009,7 @@ void writeGtkThemeControlFile(int forceRecreate) {
// stream << parse_rc_string("padding: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_)), "GtkMenuBar");
stream << parse_rc_string("padding: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_MenuBarFrameWidth)) + "px " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_MenuBarItemSpacing)*0.75) + "px", "GtkMenuBar>GtkMenuItem");
- stream << parse_rc_string("padding: " + TQString::number((tdeStandardMenuItemHeight-tqApp->style().pixelMetric(TQStyle::PM_IndicatorHeight))/2) + "px " + TQString::number(0) + "px", "GtkMenu>GtkMenuItem");
+ stream << parse_rc_string("padding: " + TQString::number(((tdeStandardMenuItemHeight-tqApp->style().pixelMetric(TQStyle::PM_IndicatorHeight))/2)*0.75) + "px " + TQString::number(0) + "px", "GtkMenu>GtkMenuItem");
stream << parse_rc_string("padding: " + TQString::number(0) + "px " + TQString::number(0) + "px", "GtkMenu>GtkMenuSpacerItem");
// stream << parse_rc_string("padding: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_)), "GtkMenu>GtkSeparatorMenuItem");