From 7299ca01b7d3f10b70f40055c77a9cb43ad02981 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 22 Oct 2023 23:06:37 +0200 Subject: [PATCH] Try to reduze widgets size --- share/ui/style.css | 16 +++++++++++++++- src/ui/dialog/document-properties.cpp | 2 +- src/ui/dialog/fill-and-stroke.cpp | 18 ++++++++---------- src/ui/dialog/inkscape-preferences.cpp | 2 ++ src/ui/dialog/tile.cpp | 1 + src/ui/dialog/transformation.cpp | 2 ++ src/ui/widget/notebook-page.cpp | 10 +++++----- src/ui/widget/notebook-page.h | 2 +- 8 files changed, 35 insertions(+), 18 deletions(-) diff --git a/share/ui/style.css b/share/ui/style.css index 82731cc80b..1147aed244 100644 --- a/share/ui/style.css +++ b/share/ui/style.css @@ -1199,9 +1199,23 @@ popover.menu.menuize > stack > box > modelbutton:first-child > * /* Affect child color: @theme_selected_bg_color; } +/*Give extra 10 px to noebooks without menus*/ + +.notebook_nomenu tab{ + margin:0px; +} + +.notebook_nomenu tab:last-child{ + min-width:10px; + margin-right:-10px; +} + +#DialogMultipaned tabs{ + padding:0; +} /* ColorSlider */ #ColorSlider { - min-width : 96px; + min-width : 36px; min-height: 8px; } diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 62c0b44e90..2ddd8e727a 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -204,7 +204,7 @@ DocumentProperties::DocumentProperties() populate_available_profiles(); } }); - + _notebook.get_style_context()->add_class("notebook_nomenu"); _wr.setUpdating (true); build_page(); build_guides(); diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index ffb1cb9420..6c96ae1dac 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -35,9 +35,9 @@ namespace Inkscape::UI::Dialog { FillAndStroke::FillAndStroke() : DialogBase("/dialogs/fillstroke", "FillStroke") - , _page_fill(Gtk::make_managed(1, 1, true, true)) - , _page_stroke_paint(Gtk::make_managed(1, 1, true, true)) - , _page_stroke_style(Gtk::make_managed(1, 1, true, true)) + , _page_fill(Gtk::make_managed(1, 1, true, true, 0, 0)) + , _page_stroke_paint(Gtk::make_managed(1, 1, true, true, 0, 0)) + , _page_stroke_style(Gtk::make_managed(1, 1, true, true, 0, 0)) , _composite_settings(INKSCAPE_ICON("dialog-fill-and-stroke"), "fillstroke", UI::Widget::SimpleFilterModifier::ISOLATION | @@ -47,19 +47,19 @@ FillAndStroke::FillAndStroke() , fillWdgt(nullptr) , strokeWdgt(nullptr) { - set_spacing(2); - UI::pack_start(*this, _notebook, true, true); + set_spacing(0); + UI::pack_start(*this, _notebook, false, false ); _notebook.append_page(*_page_fill, _createPageTabLabel(_("_Fill"), INKSCAPE_ICON("object-fill"))); _notebook.append_page(*_page_stroke_paint, _createPageTabLabel(_("Stroke _paint"), INKSCAPE_ICON("object-stroke"))); _notebook.append_page(*_page_stroke_style, _createPageTabLabel(_("Stroke st_yle"), INKSCAPE_ICON("object-stroke-style"))); - _notebook.set_vexpand(true); + _notebook.set_vexpand(false); _notebook.signal_switch_page().connect(sigc::mem_fun(*this, &FillAndStroke::_onSwitchPage)); - + _notebook.get_style_context()->add_class("notebook_nomenu"); _layoutPageFill(); _layoutPageStrokePaint(); - _layoutPageStrokeStyle(); + //_layoutPageStrokeStyle(); UI::pack_end(*this, _composite_settings, UI::PackOptions::shrink); @@ -149,8 +149,6 @@ void FillAndStroke::_layoutPageStrokeStyle() { strokeStyleWdgt = Gtk::make_managed(); - strokeStyleWdgt->set_hexpand(); - strokeStyleWdgt->set_halign(Gtk::ALIGN_START); _page_stroke_style->table().attach(*strokeStyleWdgt, 0, 0, 1, 1); } diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 272250f197..73e2b5eceb 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -2101,6 +2101,7 @@ void InkscapePreferences::initPageUI() _grids_notebook.append_page(_grids_xy, _("Rectangular Grid")); _grids_notebook.append_page(_grids_axonom, _("Axonometric Grid")); _grids_notebook.append_page(grid_modular, _("Modular Grid")); + _grids_notebook.get_style_context()->add_class("notebook_nomenu"); { // Rectangular SPGrid properties _grids_xy_units.init("/options/grids/xy/units"); @@ -3144,6 +3145,7 @@ void InkscapePreferences::initKeyboardShortcuts(Gtk::TreeModel::iterator iter_ui _kb_shortcut_renderer.signal_accel_cleared().connect( sigc::mem_fun(*this, &InkscapePreferences::onKBTreeCleared) ); _kb_notebook.append_page(_kb_page_shortcuts, _("Shortcuts")); + _kb_notebook.get_style_context()->add_class("notebook_nomenu"); auto const shortcut_scroller = Gtk::make_managed(); shortcut_scroller->add(_kb_tree); shortcut_scroller->set_hexpand(); diff --git a/src/ui/dialog/tile.cpp b/src/ui/dialog/tile.cpp index ce6080f114..4f74d1359d 100644 --- a/src/ui/dialog/tile.cpp +++ b/src/ui/dialog/tile.cpp @@ -65,6 +65,7 @@ ArrangeDialog::ArrangeDialog() _notebook->signal_switch_page().connect([=](Widget*, guint page){ update_arrange_btn(); }); + _notebook->get_style_context()->add_class("notebook_nomenu"); UI::pack_start(*this, *_arrangeBox); // Add button diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 736248605e..d75fd51063 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -117,6 +117,8 @@ Transformation::Transformation() _notebook.append_page(_page_transform, _("Matri_x"), true); layoutPageTransform(); + _notebook.get_style_context()->add_class("notebook_nomenu"); + _tabSwitchConn = _notebook.signal_switch_page().connect(sigc::mem_fun(*this, &Transformation::onSwitchPage)); // Apply separately diff --git a/src/ui/widget/notebook-page.cpp b/src/ui/widget/notebook-page.cpp index c2d211c959..a3d6ee93e9 100644 --- a/src/ui/widget/notebook-page.cpp +++ b/src/ui/widget/notebook-page.cpp @@ -20,16 +20,16 @@ namespace Inkscape { namespace UI { namespace Widget { -NotebookPage::NotebookPage(int n_rows, int n_columns, bool expand, bool fill, guint padding) +NotebookPage::NotebookPage(int n_rows, int n_columns, bool expand, bool fill, guint padding, guint spacing) : Gtk::Box(Gtk::ORIENTATION_VERTICAL) , _table(Gtk::make_managed()) { set_name("NotebookPage"); - property_margin().set_value(4); - set_spacing(4); + property_margin().set_value(spacing); + set_spacing(spacing); - _table->set_row_spacing(4); - _table->set_column_spacing(4); + _table->set_row_spacing(spacing); + _table->set_column_spacing(spacing); UI::pack_start(*this, *_table, expand, fill, padding); } diff --git a/src/ui/widget/notebook-page.h b/src/ui/widget/notebook-page.h index 9c9bd067aa..6e1be8ba6c 100644 --- a/src/ui/widget/notebook-page.h +++ b/src/ui/widget/notebook-page.h @@ -31,7 +31,7 @@ public: /** * Construct a NotebookPage. */ - NotebookPage(int n_rows, int n_columns, bool expand=false, bool fill=false, guint padding=0); + NotebookPage(int n_rows, int n_columns, bool expand=false, bool fill=false, guint padding=0, guint spacing = 4); Gtk::Grid& table() { return *_table; } -- GitLab