From 47d4199fcf2b032a02bf23c80c3b2c9f3155c5c5 Mon Sep 17 00:00:00 2001 From: Alexander Valavanis Date: Thu, 29 Jun 2017 18:13:30 +0200 Subject: aboutbox: Gtk3 fixes --- CMakeScripts/DefineDependsandFlags.cmake | 24 ++++++++++++++++++++++++ config.h.cmake | 6 ++++++ src/ui/dialog/aboutbox.cpp | 27 +++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake index 1fead418a..a98ebcf2b 100644 --- a/CMakeScripts/DefineDependsandFlags.cmake +++ b/CMakeScripts/DefineDependsandFlags.cmake @@ -258,6 +258,30 @@ set(TRY_GTKSPELL ON) set (WITH_GTKMM_3_10 ON) endif() + # Check whether we can use new features in Gtkmm 3.12 + # TODO: Drop this test and bump the version number in the GTK test above + # as soon as all supported distributions provide Gtkmm >= 3.12 + pkg_check_modules(GTKMM_3_12 + gtkmm-3.0>=3.12, + ) + + if("${GTKMM_3_12_FOUND}") + message("Using Gtkmm 3.12 build") + set (WITH_GTKMM_3_12 ON) + endif() + + # Check whether we can use new features in Gtkmm 3.16 + # TODO: Drop this test and bump the version number in the GTK test above + # as soon as all supported distributions provide Gtkmm >= 3.16 + pkg_check_modules(GTKMM_3_16 + gtkmm-3.0>=3.16, + ) + + if("${GTKMM_3_16_FOUND}") + message("Using Gtkmm 3.16 build") + set (WITH_GTKMM_3_16 ON) + endif() + # Check whether we can use new features in Gtkmm 3.22 # TODO: Drop this test and bump the version number in the GTK test above # as soon as all supported distributions provide Gtkmm >= 3.22 diff --git a/config.h.cmake b/config.h.cmake index 2cd660d87..134f7539d 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -56,6 +56,12 @@ /* Build with Gtkmm 3.10.x or higher */ #cmakedefine WITH_GTKMM_3_10 1 +/* Build with Gtkmm 3.12.x or higher */ +#cmakedefine WITH_GTKMM_3_12 1 + +/* Build with Gtkmm 3.16.x or higher */ +#cmakedefine WITH_GTKMM_3_16 1 + /* Build with Gtkmm 3.22.x or higher */ #cmakedefine WITH_GTKMM_3_22 1 diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index 805bfb562..9b99dde6b 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -107,8 +107,21 @@ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { g_strdup_printf("Inkscape %s", Inkscape::version_string); label->set_markup(label_text); + +#if WITH_GTKMM_3_10 + label->set_halign(Gtk::ALIGN_END); + label->set_valign(Gtk::ALIGN_CENTER); +#else label->set_alignment(Gtk::ALIGN_END, Gtk::ALIGN_CENTER); +#endif + +#if WITH_GTKMM_3_12 + label->set_margin_start(5); + label->set_margin_end(5); +#else label->set_padding(5,0); +#endif + g_free(label_text); label->set_selectable(true); label->show(); @@ -118,8 +131,22 @@ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { "https://www.inkscape.org"; link->set_markup(website_link); + +#if WITH_GTKMM_3_10 + link->set_halign(Gtk::ALIGN_END); +#else link->set_alignment(Gtk::ALIGN_END); +#endif + +#if WITH_GTKMM_3_12 + label->set_margin_start(5); + label->set_margin_end(5); + label->set_margin_top(5); + label->set_margin_bottom(5); +#else link->set_padding(5,5); +#endif + link->set_selectable(true); link->show(); -- cgit v1.2.3