diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2014-08-23 21:35:35 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2014-08-23 21:35:35 +0000 |
| commit | 6388fa1d00b2731feb0b9eedd03c2751d2efee84 (patch) | |
| tree | 274612e27ee561e581abb63f1a44218ced10f8fa /src/ui/widget | |
| parent | Fix orientable Gtkmm widgets (diff) | |
| download | inkscape-6388fa1d00b2731feb0b9eedd03c2751d2efee84.tar.gz inkscape-6388fa1d00b2731feb0b9eedd03c2751d2efee84.zip | |
Migrate more widgets to Gtk::Grid
(bzr r13341.1.169)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/anchor-selector.cpp | 16 | ||||
| -rw-r--r-- | src/ui/widget/anchor-selector.h | 20 |
2 files changed, 33 insertions, 3 deletions
diff --git a/src/ui/widget/anchor-selector.cpp b/src/ui/widget/anchor-selector.cpp index 82e27ee89..df00b786a 100644 --- a/src/ui/widget/anchor-selector.cpp +++ b/src/ui/widget/anchor-selector.cpp @@ -28,7 +28,11 @@ void AnchorSelector::setupButton(const Glib::ustring& icon, Gtk::ToggleButton& b AnchorSelector::AnchorSelector() : Gtk::Alignment(0.5, 0, 0, 0), +#if WITH_GTKMM_3_0 + _container() +#else _container(3, 3, true) +#endif { setupButton(INKSCAPE_ICON("boundingbox_top_left"), _buttons[0]); setupButton(INKSCAPE_ICON("boundingbox_top"), _buttons[1]); @@ -40,10 +44,20 @@ AnchorSelector::AnchorSelector() setupButton(INKSCAPE_ICON("boundingbox_bottom"), _buttons[7]); setupButton(INKSCAPE_ICON("boundingbox_bottom_right"), _buttons[8]); +#if WITH_GTKMM_3_0 + _container.set_row_homogeneous(); + _container.set_column_homogeneous(true); +#endif + for(int i = 0; i < 9; ++i) { _buttons[i].signal_clicked().connect( sigc::bind(sigc::mem_fun(*this, &AnchorSelector::btn_activated), i)); + +#if WITH_GTKMM_3_0 + _container.attach(_buttons[i], i % 3, i / 3, 1, 1); +#else _container.attach(_buttons[i], i % 3, i % 3+1, i / 3, i / 3+1, Gtk::FILL, Gtk::FILL); +#endif } _selection = 4; _buttons[4].set_active(); @@ -94,4 +108,4 @@ void AnchorSelector::setAlignment(int horizontal, int vertical) fill-column:99 End: */ -// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/ui/widget/anchor-selector.h b/src/ui/widget/anchor-selector.h index 2263438e3..0a702d296 100644 --- a/src/ui/widget/anchor-selector.h +++ b/src/ui/widget/anchor-selector.h @@ -10,7 +10,18 @@ #ifndef ANCHOR_SELECTOR_H_ #define ANCHOR_SELECTOR_H_ -#include <gtkmm.h> +#if HAVE_CONFIG_H + #include "config.h" +#endif + +#include <gtkmm/alignment.h> +#include <gtkmm/togglebutton.h> + +#if WITH_GTKMM_3_0 + #include <gtkmm/grid.h> +#else + #include <gtkmm/table.h> +#endif namespace Inkscape { namespace UI { @@ -21,7 +32,12 @@ class AnchorSelector : public Gtk::Alignment private: Gtk::ToggleButton _buttons[9]; int _selection; + +#if WITH_GTKMM_3_0 + Gtk::Grid _container; +#else Gtk::Table _container; +#endif sigc::signal<void> _selectionChanged; @@ -56,4 +72,4 @@ public: fill-column:99 End: */ -// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |
