summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/glyphs.cpp
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2016-07-28 15:16:18 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2016-07-28 15:16:18 +0000
commitdcd91f59f597ab4af07cee5929ce0e2e1f9104d5 (patch)
tree2cf4e55d031d71cc18a213d76d15a4a5a8128fe5 /src/ui/dialog/glyphs.cpp
parentui/widgets: Drop GTK2 fallbacks (diff)
downloadinkscape-dcd91f59f597ab4af07cee5929ce0e2e1f9104d5.tar.gz
inkscape-dcd91f59f597ab4af07cee5929ce0e2e1f9104d5.zip
Drop remaining GTKMM 2 fallback support
(bzr r15023.2.7)
Diffstat (limited to 'src/ui/dialog/glyphs.cpp')
-rw-r--r--src/ui/dialog/glyphs.cpp79
1 files changed, 6 insertions, 73 deletions
diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp
index 56b001291..1453797de 100644
--- a/src/ui/dialog/glyphs.cpp
+++ b/src/ui/dialog/glyphs.cpp
@@ -19,13 +19,7 @@
#include <gtkmm/label.h>
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
-
-#if WITH_GTKMM_3_0
-# include <gtkmm/grid.h>
-#else
-# include <gtkmm/table.h>
-#endif
-
+#include <gtkmm/grid.h>
#include <gtkmm/treemodelcolumn.h>
#include <gtkmm/widget.h>
@@ -342,12 +336,7 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
instanceConns(),
desktopConns()
{
-#if WITH_GTKMM_3_0
- Gtk::Grid *table = new Gtk::Grid();
-#else
- Gtk::Table *table = new Gtk::Table(3, 1, false);
-#endif
-
+ auto table = new Gtk::Grid();
_getContents()->pack_start(*Gtk::manage(table), Gtk::PACK_EXPAND_WIDGET);
guint row = 0;
@@ -360,29 +349,16 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
gtk_widget_set_size_request (fontsel, 0, 150);
g_signal_connect( G_OBJECT(fontsel), "font_set", G_CALLBACK(fontChangeCB), this );
-#if WITH_GTKMM_3_0
table->attach(*Gtk::manage(Glib::wrap(fontsel)), 0, row, 3, 1);
-#else
- table->attach(*Gtk::manage(Glib::wrap(fontsel)),
- 0, 3, row, row + 1,
- Gtk::SHRINK|Gtk::FILL, Gtk::SHRINK|Gtk::FILL);
-#endif
-
row++;
// -------------------------------
{
- Gtk::Label *label = new Gtk::Label(_("Script: "));
+ auto label = new Gtk::Label(_("Script: "));
-#if WITH_GTKMM_3_0
table->attach( *Gtk::manage(label), 0, row, 1, 1);
-#else
- table->attach( *Gtk::manage(label),
- 0, 1, row, row + 1,
- Gtk::SHRINK, Gtk::SHRINK);
-#endif
scriptCombo = new Gtk::ComboBoxText();
for (std::map<GUnicodeScript, Glib::ustring>::iterator it = getScriptToName().begin(); it != getScriptToName().end(); ++it)
@@ -396,14 +372,8 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
Gtk::Alignment *align = Gtk::manage(new Gtk::Alignment(Gtk::ALIGN_START, Gtk::ALIGN_START, 0.0, 0.0));
align->add(*Gtk::manage(scriptCombo));
-#if WITH_GTKMM_3_0
align->set_hexpand();
table->attach( *align, 1, row, 1, 1);
-#else
- table->attach( *align,
- 1, 2, row, row + 1,
- Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK);
-#endif
}
row++;
@@ -411,15 +381,8 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
// -------------------------------
{
- Gtk::Label *label = new Gtk::Label(_("Range: "));
-
-#if WITH_GTKMM_3_0
+ auto label = new Gtk::Label(_("Range: "));
table->attach( *Gtk::manage(label), 0, row, 1, 1);
-#else
- table->attach( *Gtk::manage(label),
- 0, 1, row, row + 1,
- Gtk::SHRINK, Gtk::SHRINK);
-#endif
rangeCombo = new Gtk::ComboBoxText();
for ( std::vector<NamedRange>::iterator it = getRanges().begin(); it != getRanges().end(); ++it ) {
@@ -431,15 +394,8 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
instanceConns.push_back(conn);
Gtk::Alignment *align = new Gtk::Alignment(Gtk::ALIGN_START, Gtk::ALIGN_START, 0.0, 0.0);
align->add(*Gtk::manage(rangeCombo));
-
-#if WITH_GTKMM_3_0
align->set_hexpand();
table->attach( *Gtk::manage(align), 1, row, 1, 1);
-#else
- table->attach( *Gtk::manage(align),
- 1, 2, row, row + 1,
- Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK);
-#endif
}
row++;
@@ -462,16 +418,9 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
Gtk::ScrolledWindow *scroller = new Gtk::ScrolledWindow();
scroller->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
scroller->add(*Gtk::manage(iconView));
-
-#if WITH_GTKMM_3_0
scroller->set_hexpand();
scroller->set_vexpand();
table->attach(*Gtk::manage(scroller), 0, row, 3, 1);
-#else
- table->attach(*Gtk::manage(scroller),
- 0, 3, row, row + 1,
- Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL);
-#endif
row++;
@@ -501,15 +450,8 @@ GlyphsPanel::GlyphsPanel(gchar const *prefsPath) :
insertBtn->set_sensitive(false);
box->pack_end(*Gtk::manage(insertBtn), Gtk::PACK_SHRINK);
-
-#if WITH_GTKMM_3_0
box->set_hexpand();
table->attach( *Gtk::manage(box), 0, row, 3, 1);
-#else
- table->attach( *Gtk::manage(box),
- 0, 3, row, row + 1,
- Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK);
-#endif
row++;
@@ -591,12 +533,7 @@ void GlyphsPanel::insertText()
if (entry->get_text_length() > 0) {
glyphs = entry->get_text();
} else {
-
-#if WITH_GTKMM_3_0
- std::vector<Gtk::TreePath> itemArray = iconView->get_selected_items();
-#else
- Gtk::IconView::ArrayHandle_TreePaths itemArray = iconView->get_selected_items();
-#endif
+ auto itemArray = iconView->get_selected_items();
if (!itemArray.empty()) {
Gtk::TreeModel::Path const & path = *itemArray.begin();
@@ -641,11 +578,7 @@ void GlyphsPanel::glyphActivated(Gtk::TreeModel::Path const & path)
void GlyphsPanel::glyphSelectionChanged()
{
-#if WITH_GTKMM_3_0
- std::vector<Gtk::TreePath> itemArray = iconView->get_selected_items();
-#else
- Gtk::IconView::ArrayHandle_TreePaths itemArray = iconView->get_selected_items();
-#endif
+ auto itemArray = iconView->get_selected_items();
if (itemArray.empty()) {
label->set_text(" ");