From e4aaa36123a7d9c9d44938e44d751d3a5d816d76 Mon Sep 17 00:00:00 2001 From: mental Date: Sat, 27 May 2006 05:47:13 +0000 Subject: [PATCH] make button labels translatable, and use HButtonBox versus HBox for better appearance --- ChangeLog | 7 +++++++ src/dialogs/layers-panel.cpp | 36 ++++++++++++++++++++---------------- src/dialogs/layers-panel.h | 3 ++- 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3edb6e86b..42b1325b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-26 MenTaLguY + + * src/dialogs/layers-panel.h, src/dialogs/layers-panel.cpp: + + make button labels translatable, and use HButtonBox instead of HBox for + better appearance + 2006-05-26 Jon A. Cruz * src/layer-manager.cpp, src/layer-manager.h, diff --git a/src/dialogs/layers-panel.cpp b/src/dialogs/layers-panel.cpp index 31e9823c6..4af154062 100644 --- a/src/dialogs/layers-panel.cpp +++ b/src/dialogs/layers-panel.cpp @@ -12,6 +12,8 @@ # include #endif +#include + #include #include "inkscape.h" @@ -130,10 +132,10 @@ protected: const Glib::ustring& path, const Gdk::Rectangle& background_area, const Gdk::Rectangle& cell_area, - Gtk::CellRendererState flags) { - bool val = false; + Gtk::CellRendererState flags) + { _signal_toggled.emit(path); - return val; + return false; } @@ -639,44 +641,46 @@ LayersPanel::LayersPanel() : SPDesktop* targetDesktop = SP_ACTIVE_DESKTOP; + _buttonsRow.set_child_min_width( 16 ); + Gtk::Button* btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, GTK_STOCK_ADD, "Ne" ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, GTK_STOCK_ADD, _("New") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_NEW) ); - _buttonsRow.pack_start( *btn ); + _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, "Top" ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, _("Top") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_TOP) ); _watchingNonTop.push_back( btn ); - _buttonsRow.pack_start( *btn ); + _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, "Up" ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, _("Up") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_UP) ); _watchingNonTop.push_back( btn ); - _buttonsRow.pack_start( *btn ); + _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, "Dn" ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, _("Dn") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DOWN) ); _watchingNonBottom.push_back( btn ); - _buttonsRow.pack_start( *btn ); + _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, GTK_STOCK_GOTO_BOTTOM, "Btm" ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, GTK_STOCK_GOTO_BOTTOM, _("Bot") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_BOTTOM) ); _watchingNonBottom.push_back( btn ); - _buttonsRow.pack_start( *btn ); + _buttonsRow.add( *btn ); // btn = manage( new Gtk::Button("Dup") ); // btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DUPLICATE) ); -// _buttonsRow.pack_start( *btn ); +// _buttonsRow.add( *btn ); btn = manage( new Gtk::Button() ); - _styleButton( *btn, targetDesktop, SP_VERB_LAYER_DELETE, GTK_STOCK_REMOVE, "X" ); + _styleButton( *btn, targetDesktop, SP_VERB_LAYER_DELETE, GTK_STOCK_REMOVE, _("X") ); btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DELETE) ); _watching.push_back( btn ); - _buttonsRow.pack_start( *btn ); + _buttonsRow.add( *btn ); diff --git a/src/dialogs/layers-panel.h b/src/dialogs/layers-panel.h index f7a9f0799..63cff3ede 100644 --- a/src/dialogs/layers-panel.h +++ b/src/dialogs/layers-panel.h @@ -16,6 +16,7 @@ #include #include #include +#include #include "ui/widget/panel.h" //#include "ui/previewholder.h" @@ -101,7 +102,7 @@ private: Gtk::Tooltips _tips; Gtk::TreeView _tree; - Gtk::HBox _buttonsRow; + Gtk::HButtonBox _buttonsRow; Gtk::ScrolledWindow _scroller; Gtk::Menu _popupMenu; }; -- 2.30.2