Merge branch 'master' into 'gtk3'

Most conflicts seemed to be simple enough. There were a lot of `append_text` to
`append` conversions for `Gtk::ComboBoxText`. The `PopUpCommon` class also saw
a lot of changes with non-trivial conflict resolutions.
This commit is contained in:
Adam Reichold
2016-01-06 23:56:12 +01:00
167 changed files with 13108 additions and 2410 deletions

View File

@@ -21,6 +21,8 @@
#include "popupbutton.h"
#include <gtkmm/grid.h>
/*
* PopUpButton::PopUpButton (const Glib::ustring& label, bool imgRight)
*
@@ -28,8 +30,14 @@
*
* Parameters:
* label = label displayed in the button
* nextOnClicked = selects the next entry if the button is clicked
*/
PopUpButton::PopUpButton (const Glib::ustring& label) : Gtk::Button(), PopUpCommon(this, label) { }
PopUpButton::PopUpButton (const Glib::ustring& label, bool nextOnClicked)
: Gtk::Button ()
, PopUpCommon (this, label)
, nextOnClicked(nextOnClicked)
{
}
void PopUpButton::show()
{
@@ -39,3 +47,27 @@ void PopUpButton::set_tooltip_text (const Glib::ustring &text)
{
PopUpCommon::set_tooltip_text (text);
}
void PopUpButton::set_sensitive (bool isSensitive)
{
buttonGroup->set_sensitive(isSensitive);
}
bool PopUpButton::on_button_release_event (GdkEventButton* event)
{
if (nextOnClicked && getEntryCount () > 1)
{
const int last = getEntryCount () - 1;
int next = getSelected ();
if (event->state & GDK_SHIFT_MASK) {
next = next > 0 ? next - 1 : last;
} else {
next = next < last ? next + 1 : 0;
}
entrySelected (next);
}
return Gtk::Button::on_button_release_event(event);
}