diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-03-21 22:48:35 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-03-22 17:37:54 +0000 |
| commit | 750166c03c882fc7ef6ac45fdea32d34789ff1a4 (patch) | |
| tree | b3c8a8c307ee2a3c445f079c667a77b468adb76c /src | |
| parent | Document Properties: General UI cleanup (diff) | |
| download | inkscape-750166c03c882fc7ef6ac45fdea32d34789ff1a4.tar.gz inkscape-750166c03c882fc7ef6ac45fdea32d34789ff1a4.zip | |
Realign labels in "Fill and Stroke" dialog
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/fill-and-stroke.cpp | 5 | ||||
| -rw-r--r-- | src/ui/widget/color-scales.cpp | 4 | ||||
| -rw-r--r-- | src/ui/widget/dash-selector.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/spw-utilities.cpp | 84 | ||||
| -rw-r--r-- | src/widgets/stroke-style.cpp | 11 | ||||
| -rw-r--r-- | src/widgets/stroke-style.h | 2 |
7 files changed, 56 insertions, 58 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 622334b97..6e3878164 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -781,7 +781,7 @@ void DocumentProperties::build_scripting() { _page_scripting->show(); - _page_scripting->table().attach(_scripting_notebook, 0, 0); + _page_scripting->table().attach(_scripting_notebook, 0, 0, 1, 1); _scripting_notebook.append_page(*_page_external_scripts, _("External scripts")); _scripting_notebook.append_page(*_page_embedded_scripts, _("Embedded scripts")); diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index 67de34731..5cc7c48e6 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -141,9 +141,10 @@ FillAndStroke::_layoutPageStrokePaint() void FillAndStroke::_layoutPageStrokeStyle() { - //Gtk::Widget *strokeStyleWdgt = manage(Glib::wrap(sp_stroke_style_line_widget_new())); - //Gtk::Widget *strokeStyleWdgt = static_cast<Gtk::Widget *>(sp_stroke_style_line_widget_new()); strokeStyleWdgt = sp_stroke_style_line_widget_new(); + strokeStyleWdgt->set_hexpand(); + strokeStyleWdgt->set_halign(Gtk::ALIGN_CENTER); + _page_stroke_style->table().attach(*strokeStyleWdgt, 0, 0, 1, 1); } diff --git a/src/ui/widget/color-scales.cpp b/src/ui/widget/color-scales.cpp index 1229801d1..588e9a84d 100644 --- a/src/ui/widget/color-scales.cpp +++ b/src/ui/widget/color-scales.cpp @@ -91,7 +91,7 @@ void ColorScales::_initUI(SPColorScalesMode mode) /* Label */ _l[i] = gtk_label_new(""); - gtk_widget_set_halign(_l[i], GTK_ALIGN_END); + gtk_widget_set_halign(_l[i], GTK_ALIGN_START); gtk_widget_show(_l[i]); #if GTK_CHECK_VERSION(3, 12, 0) @@ -138,7 +138,7 @@ void ColorScales::_initUI(SPColorScalesMode mode) #endif gtk_widget_set_margin_top(_b[i], YPAD); gtk_widget_set_margin_bottom(_b[i], YPAD); - gtk_widget_set_halign(_b[i], GTK_ALIGN_CENTER); + gtk_widget_set_halign(_b[i], GTK_ALIGN_END); gtk_widget_set_valign(_b[i], GTK_ALIGN_CENTER); gtk_grid_attach(GTK_GRID(t), _b[i], 2, i, 1, 1); diff --git a/src/ui/widget/dash-selector.cpp b/src/ui/widget/dash-selector.cpp index ea5cc57d2..897b964e4 100644 --- a/src/ui/widget/dash-selector.cpp +++ b/src/ui/widget/dash-selector.cpp @@ -53,6 +53,8 @@ DashSelector::DashSelector() preview_height(16), preview_lineheight(2) { + set_spacing(4); + // TODO: find something more sensible here!! init_dashes(); @@ -65,7 +67,8 @@ DashSelector::DashSelector() dash_combo.show(); dash_combo.signal_changed().connect( sigc::mem_fun(*this, &DashSelector::on_selection) ); - this->pack_start(dash_combo, false, false, 0); + this->pack_start(dash_combo, true, true, 0); + offset = Gtk::Adjustment::create(0.0, 0.0, 10.0, 0.1, 1.0, 0.0); offset->signal_value_changed().connect(sigc::mem_fun(*this, &DashSelector::offset_value_changed)); auto sb = new Inkscape::UI::Widget::SpinButton(offset, 0.1, 2); @@ -75,7 +78,6 @@ DashSelector::DashSelector() this->pack_start(*sb, false, false, 0); - int np=0; while (dashes[np]){ np++;} for (int i = 0; i<np-1; i++) { // all but the custom one go this way diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp index f0fd21c2b..aac323cf6 100644 --- a/src/widgets/spw-utilities.cpp +++ b/src/widgets/spw-utilities.cpp @@ -30,28 +30,24 @@ Gtk::Label * spw_label(Gtk::Grid *table, const gchar *label_text, int col, int r { Gtk::Label *label_widget = new Gtk::Label(); g_assert(label_widget != nullptr); - if (target != nullptr) - { + if (target != nullptr) { label_widget->set_text_with_mnemonic(label_text); - label_widget->set_mnemonic_widget(*target); - } - else - { + label_widget->set_mnemonic_widget(*target); + } else { label_widget->set_text(label_text); } label_widget->show(); - label_widget->set_hexpand(); - label_widget->set_halign(Gtk::ALIGN_FILL); + label_widget->set_halign(Gtk::ALIGN_START); label_widget->set_valign(Gtk::ALIGN_CENTER); - #if GTK_CHECK_VERSION(3,12,0) +#if GTK_CHECK_VERSION(3,12,0) label_widget->set_margin_start(4); label_widget->set_margin_end(4); - #else +#else label_widget->set_margin_left(4); label_widget->set_margin_right(4); - #endif +#endif table->attach(*label_widget, col, row, 1, 1); @@ -79,7 +75,7 @@ Gtk::HBox * spw_hbox(Gtk::Grid * table, int width, int col, int row) static void sp_set_font_size_recursive (GtkWidget *w, gpointer font) { - guint size = GPOINTER_TO_UINT (font); + guint size = GPOINTER_TO_UINT (font); auto css_provider = gtk_css_provider_new(); @@ -98,9 +94,9 @@ sp_set_font_size_recursive (GtkWidget *w, gpointer font) GTK_STYLE_PROVIDER(css_provider), GTK_STYLE_PROVIDER_PRIORITY_USER); - if (GTK_IS_CONTAINER(w)) { - gtk_container_foreach (GTK_CONTAINER(w), (GtkCallback) sp_set_font_size_recursive, font); - } + if (GTK_IS_CONTAINER(w)) { + gtk_container_foreach (GTK_CONTAINER(w), (GtkCallback) sp_set_font_size_recursive, font); + } g_object_unref(css_provider); } @@ -108,16 +104,16 @@ sp_set_font_size_recursive (GtkWidget *w, gpointer font) void sp_set_font_size (GtkWidget *w, guint font) { - sp_set_font_size_recursive (w, GUINT_TO_POINTER(font)); + sp_set_font_size_recursive (w, GUINT_TO_POINTER(font)); } void sp_set_font_size_smaller (GtkWidget *w) { - PangoContext *pc = gtk_widget_get_pango_context (w); - PangoFontDescription* pfd = pango_context_get_font_description (pc); - guint size = pango_font_description_get_size (pfd); - sp_set_font_size_recursive (w, GUINT_TO_POINTER((int) (0.8*size))); + PangoContext *pc = gtk_widget_get_pango_context (w); + PangoFontDescription* pfd = pango_context_get_font_description (pc); + guint size = pango_font_description_get_size (pfd); + sp_set_font_size_recursive (w, GUINT_TO_POINTER((int) (0.8*size))); } /** @@ -125,22 +121,22 @@ sp_set_font_size_smaller (GtkWidget *w) */ gpointer sp_search_by_data_recursive(GtkWidget *w, gpointer key) { - gpointer r = nullptr; + gpointer r = nullptr; - if (w && G_IS_OBJECT(w)) { - r = g_object_get_data(G_OBJECT(w), (gchar *) key); - } - if (r) return r; + if (w && G_IS_OBJECT(w)) { + r = g_object_get_data(G_OBJECT(w), (gchar *) key); + } + if (r) return r; - if (GTK_IS_CONTAINER(w)) { + if (GTK_IS_CONTAINER(w)) { std::vector<Gtk::Widget*> children = Glib::wrap(GTK_CONTAINER(w))->get_children(); - for (auto i:children) { - r = sp_search_by_data_recursive(GTK_WIDGET(i->gobj()), key); - if (r) return r; - } - } + for (auto i:children) { + r = sp_search_by_data_recursive(GTK_WIDGET(i->gobj()), key); + if (r) return r; + } + } - return nullptr; + return nullptr; } /** @@ -184,22 +180,22 @@ sp_search_by_name_recursive(Gtk::Widget *parent, const Glib::ustring& name) */ GtkWidget *sp_search_by_value_recursive(GtkWidget *w, gchar *key, gchar *value) { - gchar *r = nullptr; + gchar *r = nullptr; - if (w && G_IS_OBJECT(w)) { - r = (gchar *) g_object_get_data(G_OBJECT(w), key); - } - if (r && !strcmp (r, value)) return w; + if (w && G_IS_OBJECT(w)) { + r = (gchar *) g_object_get_data(G_OBJECT(w), key); + } + if (r && !strcmp (r, value)) return w; - if (GTK_IS_CONTAINER(w)) { + if (GTK_IS_CONTAINER(w)) { std::vector<Gtk::Widget*> children = Glib::wrap(GTK_CONTAINER(w))->get_children(); - for (auto i:children) { - GtkWidget *child = sp_search_by_value_recursive(GTK_WIDGET(i->gobj()), key, value); - if (child) return child; - } - } + for (auto i:children) { + GtkWidget *child = sp_search_by_value_recursive(GTK_WIDGET(i->gobj()), key, value); + if (child) return child; + } + } - return nullptr; + return nullptr; } /* diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index 7dee458f4..46454d508 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -140,7 +140,7 @@ Gtk::Widget *Inkscape::Widgets::createStrokeStyleWidget( ) } StrokeStyle::StrokeStyle() : - Gtk::VBox(), + Gtk::Box(), miterLimitSpin(), widthSpin(), unitSelector(), @@ -160,16 +160,15 @@ StrokeStyle::StrokeStyle() : endMarkerConn(), _old_unit(nullptr) { - Gtk::HBox *hb; - Gtk::HBox *f = new Gtk::HBox(false, 0); - f->show(); - add(*f); table = new Gtk::Grid(); table->set_border_width(4); table->set_row_spacing(4); + table->set_hexpand(false); + table->set_halign(Gtk::ALIGN_CENTER); table->show(); - f->add(*table); + add(*table); + Gtk::HBox *hb; gint i = 0; //spw_label(t, C_("Stroke width", "_Width:"), 0, i); diff --git a/src/widgets/stroke-style.h b/src/widgets/stroke-style.h index 7d06a5173..dd8cf07dc 100644 --- a/src/widgets/stroke-style.h +++ b/src/widgets/stroke-style.h @@ -102,7 +102,7 @@ SPObject *getMarkerObj(gchar const *n, SPDocument *doc); namespace Inkscape { class StrokeStyleButton; -class StrokeStyle : public Gtk::VBox +class StrokeStyle : public Gtk::Box { public: StrokeStyle(); |
