From c6857421a9f5d60286f6a069be68a2c88363b2e3 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Thu, 12 Nov 2015 14:31:33 +0100 Subject: [PATCH] Fixed selected text on Gtk::MessageDialog. --- src/dialogs.cc | 2 +- src/juci.cc | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dialogs.cc b/src/dialogs.cc index 64997a9..8f66ab0 100644 --- a/src/dialogs.cc +++ b/src/dialogs.cc @@ -17,7 +17,7 @@ namespace sigc { #endif } -Dialog::Message::Message(const std::string &text): Gtk::MessageDialog(text, false, Gtk::MessageType::MESSAGE_INFO, Gtk::ButtonsType::BUTTONS_CLOSE, true) { +Dialog::Message::Message(const std::string &text): Gtk::MessageDialog(text, false, Gtk::MessageType::MESSAGE_INFO, Gtk::ButtonsType::BUTTONS_NONE, true) { auto g_application=g_application_get_default(); auto gio_application=Glib::wrap(g_application, true); auto application=Glib::RefPtr::cast_static(gio_application); diff --git a/src/juci.cc b/src/juci.cc index 6c8a339..6f3eb49 100644 --- a/src/juci.cc +++ b/src/juci.cc @@ -102,6 +102,14 @@ Application::Application() : Gtk::Application("no.sout.juci", Gio::APPLICATION_N Glib::set_application_name("juCi++"); + //Gtk::MessageDialog without buttons caused text to be selected, this prevents that + //Copied from https://mail.gnome.org/archives/gtk-app-devel-list/2007-October/msg00144.html + GtkSettings* settings = gtk_settings_get_default(); + if(settings) { + g_object_set(settings, "gtk-label-select-on-focus", false, NULL); + } + //End copy + window=std::unique_ptr(new Window()); }