summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-05-28 15:44:40 +0000
committerLennart Poettering <lennart@poettering.net>2006-05-28 15:44:40 +0000
commitceb1f3de8427333e255eca1c09c6741531b7fa3f (patch)
tree7e55bb83455224de0798b39aeae895d2c63c464f
parentefbdf3aa21fa65c228812458e0e5bb7c007536ba (diff)
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
-rw-r--r--src/vumeter.cc23
1 files 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 <signal.h>
#include <gtkmm.h>
+#include <gtk/gtk.h>
+
#include <polyp/polypaudio.h>
#include <polyp/glib-mainloop.h>
#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<ChannelInfo*> 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("<span size=\"18000\" color=\"black\"><b>Polypaudio Volume Meter</b></span>");
- titleLabel.set_alignment(0);
+ titleLabel.set_alignment(0, 1);
snprintf(t, sizeof(t), "Showing signal levels of source <b>%s</b>.", source_name);
subtitleLabel.set_markup(t);
- subtitleLabel.set_alignment(0);
+ subtitleLabel.set_alignment(0, 0);
vbox.pack_start(separator, false, false);