Solving issue #3531, assign classes to Gtk::Window and MyWidget

- Curve editor buttons are set to expand by default, but they are set to
shrink as soon as an accompagnying widget is set to expand
- White Balance's method button now has a centered ellipse ("...")
- White Balance's buttons are now aligned on their right
- A "withScrollbar" class is added to MyExpander if the ToolPanel's
vertical scrollbar is visible. This can let you add padding space for
the scrollbar (see #MyExpander.withScrollbar in RT default theme)
- A "maximized" and "fullscreen" class is added to the RTWindow whenever
it change state ; BEWARE: if you maximize the window then make it
fullscreen, Gtk says that the window is in a "maximized & fullscreen"
state, which mean that both class can be added at the same time to the
window.

One Gtk oddity (at least on Windows) is that you can make your window
fullscreen and still drag it around by its header bar... That's not very
practical to click on the unfullscreen button if in Single Editor mode
with vertical Tab.

I also managed to see the window in a Inconified + Maximized state. This
part of Gtk doesn't seem very robust, on Windows at least.
This commit is contained in:
Hombre
2016-12-20 01:58:37 +01:00
parent 5100126f0d
commit c7be386c3a
14 changed files with 129 additions and 58 deletions

View File

@@ -591,11 +591,8 @@ MyExpander::MyExpander(bool useEnabled, Gtk::Widget* titleWidget) :
pack_start(*titleEvBox, Gtk::PACK_EXPAND_WIDGET, 0);
//GTK318
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
updateStyle();
#endif
//GTK318
titleEvBox->signal_button_release_event().connect( sigc::mem_fun(this, & MyExpander::on_toggle) );
titleEvBox->signal_enter_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false);
titleEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false);
@@ -651,11 +648,8 @@ MyExpander::MyExpander(bool useEnabled, Glib::ustring titleLabel) :
pack_start(*titleEvBox, Gtk::PACK_EXPAND_WIDGET, 0);
//GTK318
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
updateStyle();
#endif
//GTK318
titleEvBox->signal_button_release_event().connect( sigc::mem_fun(this, & MyExpander::on_toggle));
titleEvBox->signal_enter_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false);
titleEvBox->signal_leave_notify_event().connect( sigc::mem_fun(this, & MyExpander::on_enter_leave_title), false);
@@ -691,17 +685,28 @@ bool MyExpander::on_enter_leave_enable (GdkEventCrossing* event)
return true;
}
//GTK318
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
void MyExpander::updateStyle()
{
updateVScrollbars(options.hideTPVScrollbar);
//GTK318
#if GTK_MAJOR_VERSION == 3 && GTK_MINOR_VERSION < 20
headerHBox->set_spacing(2);
headerHBox->set_border_width(1);
set_spacing(0);
set_border_width(0);
}
#endif
//GTK318
}
void MyExpander::updateVScrollbars(bool hide)
{
if (hide) {
get_style_context()->remove_class("withScrollbar");
} else {
get_style_context()->add_class("withScrollbar");
}
}
void MyExpander::setLevel (int level)
{