From 506bff7b0ea8619d634d16088a4168b088af8359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Fri, 21 Apr 2017 22:15:48 +0200 Subject: Remove version number at the bottom and the logo from the about tab. --- plugingui/maintab.cc | 14 +++++++++++--- plugingui/maintab.h | 5 +++++ plugingui/mainwindow.cc | 17 +---------------- plugingui/mainwindow.h | 4 ---- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/plugingui/maintab.cc b/plugingui/maintab.cc index d93fd5f..98e06cc 100644 --- a/plugingui/maintab.cc +++ b/plugingui/maintab.cc @@ -74,17 +74,25 @@ MainTab::MainTab(Widget* parent, CONNECT(this, settings_notifier.enable_velocity_modifier, &humanizer_frame, &FrameWidget::setOnSwitch); - CONNECT(&humanizer_frame, onSwitchChangeNotifier, this, &MainTab::humanizerOnChange); - CONNECT(this, settings_notifier.disk_cache_enable, &diskstreaming_frame, &FrameWidget::setOnSwitch); - CONNECT(&diskstreaming_frame, onSwitchChangeNotifier, this, &MainTab::diskStreamingOnChange); } +void MainTab::resize(std::size_t width, std::size_t height) +{ + Widget::resize(width, height); + + // DrumGizmo logo + Painter painter(*this); + painter.clear(); + + painter.drawImage(width - logo.width(), height - logo.height(), logo); +} + void MainTab::humanizerOnChange(bool on) { settings.enable_velocity_modifier.store(on); diff --git a/plugingui/maintab.h b/plugingui/maintab.h index abb7e8d..358871d 100644 --- a/plugingui/maintab.h +++ b/plugingui/maintab.h @@ -50,10 +50,15 @@ public: SettingsNotifier& settings_notifier, Config& config); + // From Widget: + void resize(std::size_t width, std::size_t height) override; + private: void humanizerOnChange(bool on); void diskStreamingOnChange(bool on); + Image logo{":resources/logo.png"}; + GridLayout layout{this, 2, 40}; FrameWidget drumkit_frame{this, false}; diff --git a/plugingui/mainwindow.cc b/plugingui/mainwindow.cc index 071bafe..702178f 100644 --- a/plugingui/mainwindow.cc +++ b/plugingui/mainwindow.cc @@ -60,11 +60,6 @@ MainWindow::~MainWindow() bool MainWindow::processEvents() { -// if(!initialised) -// { -// return running; -// } - settings_notifier.evaluate(); eventHandler()->processEvents(); @@ -86,23 +81,13 @@ void MainWindow::repaintEvent(RepaintEvent* repaintEvent) } Painter painter(*this); + painter.clear(); auto bar_height = tabs.getBarHeight(); // Grey background painter.drawImageStretched(0, 0, back, width(), height()); - // DrumGizmo logo - painter.drawImage(width() - logo.width() - sidebar.width(), - height() - logo.height(), logo); - - // DrumGizmo version - std::string version_string("v." + std::string(VERSION)); - auto version_x = width() - font.textWidth(version_string) - sidebar.width() - 1; - auto version_y = height() - 1; - painter.setColour(Colour(0.47)); - painter.drawText(version_x, version_y, font, version_string); - // Topbar above the sidebars topbar.setSize(16, bar_height); painter.drawImage(0, 0, topbar); diff --git a/plugingui/mainwindow.h b/plugingui/mainwindow.h index 7f95794..6ab3996 100644 --- a/plugingui/mainwindow.h +++ b/plugingui/mainwindow.h @@ -34,7 +34,6 @@ #include "texturedbox.h" #include "window.h" #include "maintab.h" -#include "font.h" #include "pluginconfig.h" namespace GUI @@ -69,7 +68,6 @@ private: AboutTab about_tab{&tabs}; Image back{":resources/bg.png"}; - Image logo{":resources/logo.png"}; TexturedBox sidebar{getImageCache(), ":resources/sidebar.png", 0, 0, // offset @@ -82,8 +80,6 @@ private: 17, 1, 1}; // dy1, dy2, dy3 bool closing{false}; - - Font font; }; } // GUI:: -- cgit v1.2.3