From 43e52610cc76034841cb4d93bc661968b565269b Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Sun, 24 Jan 2010 14:32:52 +0100 Subject: [PATCH] Re pack work area in a better way. Avoid hack sizes. --- synfig-studio/src/gtkmm/workarea.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/synfig-studio/src/gtkmm/workarea.cpp b/synfig-studio/src/gtkmm/workarea.cpp index edc989d..1ffc878 100644 --- a/synfig-studio/src/gtkmm/workarea.cpp +++ b/synfig-studio/src/gtkmm/workarea.cpp @@ -85,8 +85,6 @@ using namespace studio; /* === M A C R O S ========================================================= */ -#define RULER_FIX 15 - #ifndef stratof #define stratof(X) (atof((X).c_str())) #define stratoi(X) (atoi((X).c_str())) @@ -647,7 +645,7 @@ public: WorkArea::WorkArea(etl::loose_handle canvas_interface): - Gtk::Table(4+RULER_FIX, 3, false), + Gtk::Table(3, 3, false), /* 3 columns by 3 rows*/ canvas_interface(canvas_interface), canvas(canvas_interface->get_canvas()), scrollx_adjustment(0,-4,4,0.01,0.1), @@ -730,7 +728,7 @@ WorkArea::WorkArea(etl::loose_handle canvas_interfac drawing_frame->show(); - attach(*drawing_frame, 1, 3+RULER_FIX, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); + attach(*drawing_frame, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); Gtk::IconSize iconsize=Gtk::IconSize::from_name("synfig-small_icon"); @@ -743,7 +741,7 @@ WorkArea::WorkArea(etl::loose_handle canvas_interfac vruler->show(); hruler->show(); attach(*vruler, 0, 1, 1, 2, Gtk::SHRINK|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); - attach(*hruler, 1, 3+RULER_FIX, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0); + attach(*hruler, 1, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0); hruler->signal_event().connect(sigc::mem_fun(*this, &WorkArea::on_hruler_event)); vruler->signal_event().connect(sigc::mem_fun(*this, &WorkArea::on_vruler_event)); hruler->add_events(Gdk::BUTTON1_MOTION_MASK | Gdk::BUTTON2_MOTION_MASK |Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK|Gdk::POINTER_MOTION_MASK); @@ -757,22 +755,26 @@ WorkArea::WorkArea(etl::loose_handle canvas_interfac menubutton->signal_pressed().connect(sigc::mem_fun(*this, &WorkArea::popup_menu)); attach(*menubutton, 0, 1, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0); - + Gtk::HBox *hbox = manage(new class Gtk::HBox(false, 0)); Gtk::VScrollbar *vscrollbar1 = manage(new class Gtk::VScrollbar(*get_scrolly_adjustment())); Gtk::HScrollbar *hscrollbar1 = manage(new class Gtk::HScrollbar(*get_scrollx_adjustment())); vscrollbar1->show(); - hscrollbar1->show(); - attach(*vscrollbar1, 3+RULER_FIX, 4+RULER_FIX, 1, 2, Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); - attach(*hscrollbar1, 2+RULER_FIX, 3+RULER_FIX, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::FILL, 0, 0); + attach(*vscrollbar1, 2, 3, 1, 2, Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); ZoomDial *zoomdial=manage(new class ZoomDial(iconsize)); zoomdial->signal_zoom_in().connect(sigc::mem_fun(*this, &studio::WorkArea::zoom_in)); zoomdial->signal_zoom_out().connect(sigc::mem_fun(*this, &studio::WorkArea::zoom_out)); zoomdial->signal_zoom_fit().connect(sigc::mem_fun(*this, &studio::WorkArea::zoom_fit)); zoomdial->signal_zoom_norm().connect(sigc::mem_fun(*this, &studio::WorkArea::zoom_norm)); + + hbox->pack_end(*hscrollbar1, Gtk::PACK_EXPAND_WIDGET,0); + hscrollbar1->show(); + hbox->pack_start(*zoomdial, Gtk::PACK_SHRINK,0); zoomdial->show(); - attach(*zoomdial, 0, 2+RULER_FIX, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0); + + attach(*hbox, 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, 0, 0); + hbox->show(); drawing_area->add_events(Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); add_events(Gdk::KEY_PRESS_MASK); -- 2.7.4