summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-06-29 15:40:49 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2017-06-29 15:40:49 +0000
commitf36f7edc837b86a229f17fa03e94d6e0706e00c1 (patch)
treec1a685af6629ecdd936c5d6fb5022b6a3a483d81 /src/ui/dialog
parentMerge branch 'master' of gitlab.com:inkscape/inkscape (diff)
parentMerge branch 'master' of gitlab.com:inkscape/inkscape (diff)
downloadinkscape-f36f7edc837b86a229f17fa03e94d6e0706e00c1.tar.gz
inkscape-f36f7edc837b86a229f17fa03e94d6e0706e00c1.zip
Merge branch 'master' of gitlab.com:inkscape/inkscape
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/dock-behavior.cpp4
-rw-r--r--src/ui/dialog/grid-arrange-tab.cpp4
-rw-r--r--src/ui/dialog/grid-arrange-tab.h20
-rw-r--r--src/ui/dialog/knot-properties.cpp18
-rw-r--r--src/ui/dialog/knot-properties.h4
-rw-r--r--src/ui/dialog/layers.cpp35
-rw-r--r--src/ui/dialog/objects.cpp38
-rw-r--r--src/ui/dialog/styledialog.cpp2
-rw-r--r--src/ui/dialog/styledialog.h6
-rw-r--r--src/ui/dialog/tags.cpp4
10 files changed, 72 insertions, 63 deletions
diff --git a/src/ui/dialog/dock-behavior.cpp b/src/ui/dialog/dock-behavior.cpp
index 299584a31..0c8bb3194 100644
--- a/src/ui/dialog/dock-behavior.cpp
+++ b/src/ui/dialog/dock-behavior.cpp
@@ -39,9 +39,9 @@ DockBehavior::DockBehavior(Dialog &dialog) :
static_cast<Widget::DockItem::State>(
Inkscape::Preferences::get()->getInt(_dialog._prefs_path + "/state",
UI::Widget::DockItem::DOCKED_STATE)),
- static_cast<Widget::DockItem::Placement>(
+ static_cast<GdlDockPlacement>(
Inkscape::Preferences::get()->getInt(_dialog._prefs_path + "/placement",
- UI::Widget::DockItem::TOP)))
+ GDL_DOCK_TOP)))
{
// Connect signals
diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp
index 5d7422279..bb8fc564a 100644
--- a/src/ui/dialog/grid-arrange-tab.cpp
+++ b/src/ui/dialog/grid-arrange-tab.cpp
@@ -610,6 +610,7 @@ GridArrangeTab::GridArrangeTab(ArrangeDialog *parent)
NoOfRowsLabel.set_text_with_mnemonic(_("_Rows:"));
NoOfRowsLabel.set_mnemonic_widget(NoOfRowsSpinner);
+ NoOfRowsBox.set_orientation(Gtk::ORIENTATION_VERTICAL);
NoOfRowsBox.pack_start(NoOfRowsLabel, false, false, MARGIN);
NoOfRowsSpinner.set_digits(0);
@@ -640,6 +641,7 @@ GridArrangeTab::GridArrangeTab(ArrangeDialog *parent)
/*#### Label for X ####*/
padXByYLabel.set_label(" ");
+ XByYLabelVBox.set_orientation(Gtk::ORIENTATION_VERTICAL);
XByYLabelVBox.pack_start(padXByYLabel, false, false, MARGIN);
XByYLabel.set_markup(" &#215; ");
XByYLabelVBox.pack_start(XByYLabel, false, false, MARGIN);
@@ -650,6 +652,7 @@ GridArrangeTab::GridArrangeTab(ArrangeDialog *parent)
NoOfColsLabel.set_text_with_mnemonic(_("_Columns:"));
NoOfColsLabel.set_mnemonic_widget(NoOfColsSpinner);
+ NoOfColsBox.set_orientation(Gtk::ORIENTATION_VERTICAL);
NoOfColsBox.pack_start(NoOfColsLabel, false, false, MARGIN);
NoOfColsSpinner.set_digits(0);
@@ -676,6 +679,7 @@ GridArrangeTab::GridArrangeTab(ArrangeDialog *parent)
SpinsHBox.pack_start(NoOfColsBox, false, false, MARGIN);
+ TileBox.set_orientation(Gtk::ORIENTATION_VERTICAL);
TileBox.pack_start(SpinsHBox, false, false, MARGIN);
VertAlign = prefs->getInt("/dialogs/gridtiler/VertAlign", 1);
diff --git a/src/ui/dialog/grid-arrange-tab.h b/src/ui/dialog/grid-arrange-tab.h
index 891849f1a..93bc38218 100644
--- a/src/ui/dialog/grid-arrange-tab.h
+++ b/src/ui/dialog/grid-arrange-tab.h
@@ -73,7 +73,7 @@ private:
bool userHidden;
bool updating;
- Gtk::VBox TileBox;
+ Gtk::Box TileBox;
Gtk::Button *TileOkButton;
Gtk::Button *TileCancelButton;
@@ -81,22 +81,22 @@ private:
Gtk::Label SelectionContentsLabel;
- Gtk::HBox AlignHBox;
- Gtk::HBox SpinsHBox;
+ Gtk::Box AlignHBox;
+ Gtk::Box SpinsHBox;
// Number per Row
- Gtk::VBox NoOfColsBox;
+ Gtk::Box NoOfColsBox;
Gtk::Label NoOfColsLabel;
Inkscape::UI::Widget::SpinButton NoOfColsSpinner;
bool AutoRowSize;
Gtk::CheckButton RowHeightButton;
- Gtk::VBox XByYLabelVBox;
+ Gtk::Box XByYLabelVBox;
Gtk::Label padXByYLabel;
Gtk::Label XByYLabel;
// Number per Column
- Gtk::VBox NoOfRowsBox;
+ Gtk::Box NoOfRowsBox;
Gtk::Label NoOfRowsLabel;
Inkscape::UI::Widget::SpinButton NoOfRowsSpinner;
bool AutoColSize;
@@ -121,15 +121,11 @@ private:
bool ManualSpacing;
// Row height
- Gtk::VBox RowHeightVBox;
- Gtk::HBox RowHeightBox;
- Gtk::Label RowHeightLabel;
+ Gtk::Box RowHeightBox;
Inkscape::UI::Widget::SpinButton RowHeightSpinner;
// Column width
- Gtk::VBox ColumnWidthVBox;
- Gtk::HBox ColumnWidthBox;
- Gtk::Label ColumnWidthLabel;
+ Gtk::Box ColumnWidthBox;
Inkscape::UI::Widget::SpinButton ColumnWidthSpinner;
};
diff --git a/src/ui/dialog/knot-properties.cpp b/src/ui/dialog/knot-properties.cpp
index 954fe2a66..9008d943a 100644
--- a/src/ui/dialog/knot-properties.cpp
+++ b/src/ui/dialog/knot-properties.cpp
@@ -45,14 +45,15 @@ KnotPropertiesDialog::KnotPropertiesDialog()
{
Gtk::Box *mainVBox = get_vbox();
- _layout_table.set_spacings(4);
- _layout_table.resize (2, 2);
+ _layout_table.set_row_spacing(4);
+ _layout_table.set_column_spacing(4);
_unit_name = "";
// Layer name widgets
_knot_x_entry.set_activates_default(true);
_knot_x_entry.set_digits(4);
_knot_x_entry.set_increments(1,1);
_knot_x_entry.set_range(-G_MAXDOUBLE, G_MAXDOUBLE);
+ _knot_x_entry.set_hexpand();
_knot_x_label.set_label(_("Position X:"));
_knot_x_label.set_alignment(1.0, 0.5);
@@ -60,16 +61,15 @@ KnotPropertiesDialog::KnotPropertiesDialog()
_knot_y_entry.set_digits(4);
_knot_y_entry.set_increments(1,1);
_knot_y_entry.set_range(-G_MAXDOUBLE, G_MAXDOUBLE);
- _knot_y_label.set_label(_("Position Y:"));
+ _knot_y_entry.set_hexpand();
+ _knot_y_label.set_label(_("Position Y:"));
_knot_y_label.set_alignment(1.0, 0.5);
- _layout_table.attach(_knot_x_label,
- 0, 1, 0, 1, Gtk::FILL, Gtk::FILL);
- _layout_table.attach(_knot_x_entry,
- 1, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
+ _layout_table.attach(_knot_x_label, 0, 0, 1, 1);
+ _layout_table.attach(_knot_x_entry, 1, 0, 1, 1);
- _layout_table.attach(_knot_y_label, 0, 1, 1, 2, Gtk::FILL, Gtk::FILL);
- _layout_table.attach(_knot_y_entry, 1, 2, 1, 2, Gtk::FILL | Gtk::EXPAND, Gtk::FILL);
+ _layout_table.attach(_knot_y_label, 0, 1, 1, 1);
+ _layout_table.attach(_knot_y_entry, 1, 1, 1, 1);
mainVBox->pack_start(_layout_table, true, true, 4);
diff --git a/src/ui/dialog/knot-properties.h b/src/ui/dialog/knot-properties.h
index f6157168f..1297eae1f 100644
--- a/src/ui/dialog/knot-properties.h
+++ b/src/ui/dialog/knot-properties.h
@@ -13,9 +13,9 @@
#define INKSCAPE_DIALOG_KNOT_PROPERTIES_H
#include <gtkmm/dialog.h>
+#include <gtkmm/grid.h>
#include <gtkmm/label.h>
#include <gtkmm/spinbutton.h>
-#include <gtkmm/table.h>
#include <2geom/point.h>
#include "knot.h"
#include "ui/tools/measure-tool.h"
@@ -45,7 +45,7 @@ protected:
Gtk::SpinButton _knot_x_entry;
Gtk::Label _knot_y_label;
Gtk::SpinButton _knot_y_entry;
- Gtk::Table _layout_table;
+ Gtk::Grid _layout_table;
bool _position_visible;
Gtk::Button _close_button;
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index be3b4af06..7a650b034 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -15,7 +15,6 @@
#include "layers.h"
#include <gtkmm/icontheme.h>
-#include <gtkmm/imagemenuitem.h>
#include <gtkmm/separatormenuitem.h>
#include <glibmm/main.h>
@@ -113,11 +112,12 @@ void LayersPanel::_styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned i
Gtk::MenuItem& LayersPanel::_addPopupItem( SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback, int id )
{
- GtkWidget* iconWidget = 0;
+ Gtk::Image *iconWidget = nullptr;
const char* label = 0;
if ( iconName ) {
- iconWidget = gtk_image_new_from_icon_name( iconName, GTK_ICON_SIZE_MENU );
+ iconWidget = Gtk::manage(new Gtk::Image());
+ iconWidget->set_from_icon_name( iconName, Gtk::ICON_SIZE_MENU );
}
if ( desktop ) {
@@ -125,7 +125,8 @@ Gtk::MenuItem& LayersPanel::_addPopupItem( SPDesktop *desktop, unsigned int code
if ( verb ) {
SPAction *action = verb->get_action(Inkscape::ActionContext(desktop));
if ( !iconWidget && action && action->image ) {
- iconWidget = gtk_image_new_from_icon_name( action->image, GTK_ICON_SIZE_MENU );
+ iconWidget = Gtk::manage(new Gtk::Image());
+ iconWidget->set_from_icon_name( action->image, Gtk::ICON_SIZE_MENU );
}
if ( action ) {
@@ -138,21 +139,23 @@ Gtk::MenuItem& LayersPanel::_addPopupItem( SPDesktop *desktop, unsigned int code
label = fallback;
}
- Gtk::Widget* wrapped = 0;
- if ( iconWidget ) {
- wrapped = Gtk::manage(Glib::wrap(iconWidget));
- wrapped->show();
- }
-
-
- Gtk::MenuItem* item = 0;
+ auto box = Gtk::manage(new Gtk::Box());
+ Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem());
- if (wrapped) {
- item = Gtk::manage(new Gtk::ImageMenuItem(*wrapped, label, true));
- } else {
- item = Gtk::manage(new Gtk::MenuItem(label, true));
+ if (iconWidget) {
+ box->pack_start(*iconWidget, false, true, 0);
+ }
+ else {
+ Gtk::Label *fake_icon = Gtk::manage(new Gtk::Label(""));
+ box->pack_start(*fake_icon, false, true, 0);
}
+ Gtk::Label *menu_label = Gtk::manage(new Gtk::Label(label, true));
+ menu_label->set_xalign(0.0);
+ box->pack_start(*menu_label, true, true, 0);
+ item->add(*box);
+ item->show_all();
+
item->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &LayersPanel::_takeAction), id));
_popupMenu.append(*item);
diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp
index e76da241a..4b673b8b7 100644
--- a/src/ui/dialog/objects.cpp
+++ b/src/ui/dialog/objects.cpp
@@ -241,23 +241,25 @@ void ObjectsPanel::_styleButton(Gtk::Button& btn, char const* iconName, char con
*/
Gtk::MenuItem& ObjectsPanel::_addPopupItem( SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback, int id )
{
- GtkWidget* iconWidget = 0;
+ Gtk::Image *iconWidget = nullptr;
const char* label = 0;
if ( iconName ) {
- iconWidget = gtk_image_new_from_icon_name( iconName, GTK_ICON_SIZE_MENU );
+ iconWidget = Gtk::manage(new Gtk::Image());
+ iconWidget->set_from_icon_name( iconName, Gtk::ICON_SIZE_MENU );
}
if ( desktop ) {
Verb *verb = Verb::get( code );
if ( verb ) {
- SPAction *action = verb->get_action(desktop);
+ SPAction *action = verb->get_action(Inkscape::ActionContext(desktop));
if ( !iconWidget && action && action->image ) {
- iconWidget = gtk_image_new_from_icon_name( action->image, GTK_ICON_SIZE_MENU );
+ iconWidget = Gtk::manage(new Gtk::Image());
+ iconWidget->set_from_icon_name( action->image, Gtk::ICON_SIZE_MENU );
}
if ( action ) {
- // label = action->name;
+ label = action->name;
}
}
}
@@ -266,21 +268,23 @@ Gtk::MenuItem& ObjectsPanel::_addPopupItem( SPDesktop *desktop, unsigned int cod
label = fallback;
}
- Gtk::Widget* wrapped = 0;
- if ( iconWidget ) {
- wrapped = Gtk::manage(Glib::wrap(iconWidget));
- wrapped->show();
- }
-
-
- Gtk::MenuItem* item = 0;
+ auto box = Gtk::manage(new Gtk::Box());
+ Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem());
- if (wrapped) {
- item = Gtk::manage(new Gtk::ImageMenuItem(*wrapped, label, true));
- } else {
- item = Gtk::manage(new Gtk::MenuItem(label, true));
+ if (iconWidget) {
+ box->pack_start(*iconWidget, false, true, 0);
+ }
+ else {
+ Gtk::Label *fake_icon = Gtk::manage(new Gtk::Label(""));
+ box->pack_start(*fake_icon, false, true, 0);
}
+ Gtk::Label *menu_label = Gtk::manage(new Gtk::Label(label, true));
+ menu_label->set_xalign(0.0);
+ box->pack_start(*menu_label, true, true, 0);
+ item->add(*box);
+ item->show_all();
+
item->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &ObjectsPanel::_takeAction), id));
_popupMenu.append(*item);
diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp
index 73dd6937a..3642c0168 100644
--- a/src/ui/dialog/styledialog.cpp
+++ b/src/ui/dialog/styledialog.cpp
@@ -264,7 +264,9 @@ StyleDialog::StyleDialog() :
_treeView.set_expander_column(*(_treeView.get_column(1)));
// Pack widgets
+ _paned.set_orientation(Gtk::ORIENTATION_VERTICAL);
_paned.pack1(_mainBox, Gtk::SHRINK);
+ _mainBox.set_orientation(Gtk::ORIENTATION_VERTICAL);
_mainBox.pack_start(_scrolledWindow, Gtk::PACK_EXPAND_WIDGET);
_scrolledWindow.add(_treeView);
_scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
diff --git a/src/ui/dialog/styledialog.h b/src/ui/dialog/styledialog.h
index dbbc1e480..03932e3cc 100644
--- a/src/ui/dialog/styledialog.h
+++ b/src/ui/dialog/styledialog.h
@@ -108,9 +108,9 @@ private:
Glib::RefPtr<TreeStore> _store;
// Widgets
- Gtk::VPaned _paned;
- Gtk::VBox _mainBox;
- Gtk::HBox _buttonBox;
+ Gtk::Paned _paned;
+ Gtk::Box _mainBox;
+ Gtk::Box _buttonBox;
Gtk::ScrolledWindow _scrolledWindow;
Gtk::Button* del;
Gtk::Button* create;
diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp
index b990ccfef..176719995 100644
--- a/src/ui/dialog/tags.cpp
+++ b/src/ui/dialog/tags.cpp
@@ -155,7 +155,7 @@ Gtk::MenuItem& TagsPanel::_addPopupItem( SPDesktop *desktop, unsigned int code,
}
if ( action ) {
- label = action->name;
+ // label = action->name;
}
}
}
@@ -166,7 +166,7 @@ Gtk::MenuItem& TagsPanel::_addPopupItem( SPDesktop *desktop, unsigned int code,
Gtk::Widget* wrapped = 0;
if ( iconWidget ) {
- wrapped = manage(Glib::wrap(iconWidget));
+ wrapped = Gtk::manage(Glib::wrap(iconWidget));
wrapped->show();
}