From 2545b7574d42a2cc6cb15ac29aed168f031080dc Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 14 May 2019 19:48:02 +0200 Subject: Prevent dialog from becoming super-wide. --- src/ui/widget/font-variants.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ui/widget/font-variants.cpp b/src/ui/widget/font-variants.cpp index 2fb5b615b..b4f991863 100644 --- a/src/ui/widget/font-variants.cpp +++ b/src/ui/widget/font-variants.cpp @@ -29,18 +29,18 @@ namespace Widget { class Feature { public: - Feature( const Glib::ustring& name, OTSubstitution& glyphs, int options, Glib::ustring family, Gtk::Grid& grid, int row, FontVariants* parent) + Feature( const Glib::ustring& name, OTSubstitution& glyphs, int options, Glib::ustring family, Gtk::Grid& grid, int &row, FontVariants* parent) : _name (name) , _options (options) { Gtk::Label* table_name = Gtk::manage (new Gtk::Label()); table_name->set_markup ("\"" + name + "\" "); - grid.attach (*table_name, 0, row, 1, 1); Gtk::RadioButton::Group group; for (int i = 0; i < options; ++i) { - + int col = i%10; // Some fonts might have a table with many options (Bungee Hairline table 'ornm' has 113 entries). + if (i > 10 && col == 0) row++; Gtk::RadioButton* button = Gtk::manage (new Gtk::RadioButton()); if (i == 0) { group = button->get_group(); @@ -48,7 +48,7 @@ namespace Widget { button->set_group (group); } button->signal_clicked().connect ( sigc::mem_fun(*parent, &FontVariants::feature_callback) ); - grid.attach (*button, 2*i+1, row, 1, 1); + grid.attach (*button, 2*col+1, row, 1, 1); buttons.push_back (button); Gtk::Label* label = Gtk::manage (new Gtk::Label()); @@ -57,7 +57,7 @@ namespace Widget { label->set_line_wrap( true ); label->set_line_wrap_mode( Pango::WRAP_WORD_CHAR ); label->set_ellipsize( Pango::ELLIPSIZE_END ); - label->set_lines(2); + label->set_lines(3); Glib::ustring markup; markup += "