From ceb1f3de8427333e255eca1c09c6741531b7fa3f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 28 May 2006 15:44:40 +0000 Subject: set icon for window, add icon to window title git-svn-id: file:///home/lennart/svn/public/pavumeter/trunk@35 c62a5a7b-6fe3-0310-9d5a-afe6de46906b --- src/vumeter.cc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/vumeter.cc b/src/vumeter.cc index 96b729b..54895d5 100644 --- a/src/vumeter.cc +++ b/src/vumeter.cc @@ -22,12 +22,13 @@ #include #include +#include + #include #include #define LOGARITHMIC 1 - class MainWindow : public Gtk::Window { public: @@ -44,8 +45,10 @@ protected: }; Gtk::VBox vbox, titleVBox; + Gtk::HBox titleHBox; Gtk::Table table; std::vector channels; + Gtk::Image image; Gtk::Label titleLabel; Gtk::Label subtitleLabel; Gtk::HSeparator separator; @@ -89,7 +92,9 @@ MainWindow::MainWindow(const pa_channel_map &map, const char *source_name) : char t[256]; int n; - set_title("Volume Meter"); + set_title("Polypaudio Volume Meter"); + + gtk_window_set_icon_name(GTK_WINDOW(gobj()), "audio-input-microphone"); add(vbox); @@ -98,17 +103,23 @@ MainWindow::MainWindow(const pa_channel_map &map, const char *source_name) : vbox.pack_start(eventBox, false, false); - eventBox.add(titleVBox); + image.set_from_icon_name("audio-input-microphone", Gtk::ICON_SIZE_DIALOG); + + eventBox.add(titleHBox); + titleHBox.pack_start(image, false, false); + titleHBox.pack_end(titleVBox, true, true); + titleHBox.set_border_width(12); + titleHBox.set_spacing(12); + titleVBox.add(titleLabel); titleVBox.add(subtitleLabel); - titleVBox.set_border_width(12); titleVBox.set_spacing(6); titleLabel.set_markup("Polypaudio Volume Meter"); - titleLabel.set_alignment(0); + titleLabel.set_alignment(0, 1); snprintf(t, sizeof(t), "Showing signal levels of source %s.", source_name); subtitleLabel.set_markup(t); - subtitleLabel.set_alignment(0); + subtitleLabel.set_alignment(0, 0); vbox.pack_start(separator, false, false); -- cgit