From aa094a1cc6efdeeb72e8b14701f0314e92b696e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Mon, 17 Apr 2017 13:12:53 +0200 Subject: Draw version label in MainWindow instead of MainTab --- plugingui/maintab.cc | 8 -------- plugingui/maintab.h | 3 --- plugingui/mainwindow.cc | 8 ++++++++ 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 - 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 +#include #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:: -- cgit v1.2.3