1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #include "smaboutdialog.hh"
4 #include "smfixedgrid.hh"
5 #include "smlabel.hh"
6 #include "smbutton.hh"
7 #include "config.h"
8 
9 using namespace SpectMorph;
10 
AboutDialog(Window * window)11 AboutDialog::AboutDialog (Window *window) :
12   Dialog (window)
13 {
14   FixedGrid grid;
15 
16   auto title_label = new Label (this, "SpectMorph " PACKAGE_VERSION);
17   title_label->set_bold (true);
18   title_label->set_align (TextAlign::CENTER);
19 
20   grid.add_widget (title_label, 0, 0, 40, 4);
21   grid.add_widget (this, 0, 0, 40, 18);
22 
23   double yoffset = 4;
24 
25   auto web_label = new Label (this, "Website: www.spectmorph.org");
26 
27   grid.add_widget (web_label, 10, yoffset, 40, 3);
28   yoffset += 3;
29 
30   auto license_label = new Label (this, "License: GNU LGPL version 3");
31 
32   grid.add_widget (license_label, 10, yoffset, 40, 3);
33   yoffset += 3;
34 
35   auto author_label = new Label (this, "Author: Stefan Westerfeld");
36 
37   grid.add_widget (author_label, 10, yoffset, 40, 3);
38   yoffset += 4;
39 
40   auto ok_button = new Button (this, "Ok");
41   grid.add_widget (ok_button, 15, yoffset, 10, 3);
42   connect (ok_button->signal_clicked, this, &Dialog::on_accept);
43 
44   window->set_keyboard_focus (this);
45 }
46