diff options
author | André Nusser <andre.nusser@googlemail.com> | 2017-04-17 13:12:53 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2017-04-17 13:12:53 +0200 |
commit | aa094a1cc6efdeeb72e8b14701f0314e92b696e7 (patch) | |
tree | 11688a58eb24a36dd473a1a1fd8807f1f10fe7cc | |
parent | ce92bea49b5842105c667a613d0043fa0eba2b8f (diff) |
Draw version label in MainWindow instead of MainTab
-rw-r--r-- | plugingui/maintab.cc | 8 | ||||
-rw-r--r-- | plugingui/maintab.h | 3 | ||||
-rw-r--r-- | plugingui/mainwindow.cc | 8 | ||||
-rw-r--r-- | plugingui/mainwindow.h | 3 |
4 files changed, 11 insertions, 11 deletions
diff --git a/plugingui/maintab.cc b/plugingui/maintab.cc index 745557a..f328076 100644 --- a/plugingui/maintab.cc +++ b/plugingui/maintab.cc @@ -26,8 +26,6 @@ */ #include "maintab.h" -#include <version.h> - namespace GUI { @@ -63,12 +61,6 @@ MainTab::MainTab(Widget* parent) : Widget(parent) status_frame.setContent(&statusframe_content); humanizer_frame.setContent(&humanizerframe_content); diskstreaming_frame.setContent(&diskstreamingframe_content); - - version_label.setText("v." + std::string(VERSION) + " "); - version_label.setAlignment(TextAlignment::right); - version_label.setColour(Colour(0.1, 0.1, 0.2)); - layout.addItem(&version_label); - layout.setPosition(&version_label, GridLayout::GridRange{1, 2, 39, 40}); } } // GUI:: diff --git a/plugingui/maintab.h b/plugingui/maintab.h index 28f8119..9be489b 100644 --- a/plugingui/maintab.h +++ b/plugingui/maintab.h @@ -33,7 +33,6 @@ #include "statusframecontent.h" #include "humanizerframecontent.h" #include "diskstreamingframecontent.h" -#include "label.h" namespace GUI { @@ -54,8 +53,6 @@ private: StatusframeContent statusframe_content{this}; HumanizerframeContent humanizerframe_content{this}; DiskstreamingframeContent diskstreamingframe_content{this}; - - Label version_label{this}; }; } // GUI:: diff --git a/plugingui/mainwindow.cc b/plugingui/mainwindow.cc index d183037..58e73b3 100644 --- a/plugingui/mainwindow.cc +++ b/plugingui/mainwindow.cc @@ -27,6 +27,7 @@ #include "mainwindow.h" #include <config.h> +#include <version.h> #include "painter.h" @@ -93,6 +94,13 @@ void MainWindow::repaintEvent(RepaintEvent* repaintEvent) // DrumGizmo logo painter.drawImage(width() - logo.width() - 16, height() - logo.height(), logo); + + // DrumGizmo version + std::string version_string("v." + std::string(VERSION)); + auto version_x = width() - font.textWidth(version_string) - sidebar.width() - 5; + auto version_y = height() - 5; + painter.setColour(Colour(0.18)); + painter.drawText(version_x, version_y, font, version_string); // Topbar above the sidebars topbar.setSize(16, bar_height); diff --git a/plugingui/mainwindow.h b/plugingui/mainwindow.h index f922d4c..8a2f141 100644 --- a/plugingui/mainwindow.h +++ b/plugingui/mainwindow.h @@ -35,6 +35,7 @@ #include "texturedbox.h" #include "window.h" #include "maintab.h" +#include "font.h" namespace GUI { @@ -84,6 +85,8 @@ private: SettingsNotifier settings_notifier{settings}; Resource gpl{":../../COPYING"}; + + Font font; }; } // GUI:: |