From 4e32b0e0155f22c529f301c4cc0fca0bde4e9193 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Tue, 25 Dec 2012 22:19:21 -0800 Subject: [PATCH] add close button to about dialog (issue 1659) --- rtgui/splash.cc | 11 +++++++++++ rtgui/splash.h | 1 + 2 files changed, 12 insertions(+) diff --git a/rtgui/splash.cc b/rtgui/splash.cc index d77d4002a..c0f69455d 100644 --- a/rtgui/splash.cc +++ b/rtgui/splash.cc @@ -79,6 +79,13 @@ Splash::Splash (Gtk::Window& parent) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, t nb = Gtk::manage (new Gtk::Notebook ()); get_vbox()->pack_start (*nb); + // Add close button to bottom of the notebook + Gtk::Button* closeButton = Gtk::manage (new Gtk::Button (M("GENERAL_CLOSE"))); + closeButton->signal_clicked().connect( sigc::mem_fun(*this, &Splash::closePressed) ); + Gtk::HBox* bottomHBox = Gtk::manage (new Gtk::HBox ()); + bottomHBox->pack_end (*closeButton, Gtk::PACK_SHRINK, 0); + get_vbox()->pack_start (*bottomHBox, Gtk::PACK_SHRINK, 0); + // Tab 1: the image splashImage = Gtk::manage(new SplashImage ()); nb->append_page (*splashImage, M("ABOUT_TAB_SPLASH")); @@ -249,3 +256,7 @@ void Splash::showReleaseNotes() { if (releaseNotesSW) nb->set_current_page(nb->page_num(*releaseNotesSW)); } + +void Splash::closePressed() { + hide(); +} diff --git a/rtgui/splash.h b/rtgui/splash.h index 15ffbe000..8d54a58c4 100644 --- a/rtgui/splash.h +++ b/rtgui/splash.h @@ -50,6 +50,7 @@ class Splash : public Gtk::Dialog { void showReleaseNotes(); bool on_timer (); //virtual bool on_button_release_event (GdkEventButton* event); + void closePressed(); }; #endif