Skip to content
Snippets Groups Projects
Commit a4e18970 authored by SeeLook's avatar SeeLook
Browse files

Drop down menus are shifted of status bar height to not cover it.

parent fd385abf
Branches
Tags
No related merge requests found
......@@ -67,7 +67,6 @@ Tnote
- add blinking of settings icon(action) instead of expert check boxes in old versions
- enable/disable animations option
- make exam summary pretty
- there has to be some help with key shortcuts
- Tsound has to have a timer to determine rhythmical value of detected note (or a rest)
then emitting signal should contain Tchunk instead Tnote
----------------------------------------------------------------------------------------------------------------
......
1.1.5
- added new tool button with menu for score
- A note from played exam melody can be selected to start playing from it
- Come back of improved first run wizard - it is a plugin now
- First run wizard comes back improved - it is a plugin now
BUGS FIXES
- fixing bugs, mistakes and glitches...
Under the hood
- external executable-s converted to plugins loaded on demand
- audio device has single instance, the same for settings
1.1.4 alpha
- exam tips are storing their position when moved by user
......
......@@ -31,6 +31,7 @@ set(NOOTKA_SRC
gui/tmainview.cpp
gui/tmelman.cpp
gui/ttoolbar.cpp
gui/tmenu.cpp
guitar/tfingerboard.cpp
......
/***************************************************************************
* Copyright (C) 2014 by Tomasz Bojczuk *
* Copyright (C) 2014-2015 by Tomasz Bojczuk *
* tomaszbojczuk@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -17,6 +17,7 @@
***************************************************************************/
#include "tmelman.h"
#include "tmenu.h"
#include "score/tmainscore.h"
#include <exam/tqagroup.h>
#include <music/tmelody.h>
......@@ -28,7 +29,7 @@ TmelMan::TmelMan(TmainScore* score) :
QObject(score),
m_score(score)
{
m_menu = new QMenu(score);
m_menu = new Tmenu(score);
m_playMelAct = createAction(tr("Play"), SLOT(playMelodySlot()), QKeySequence(Qt::Key_Space),
QIcon(score->style()->standardIcon(QStyle::SP_MediaPlay)));
m_recMelAct = createAction(tr("Record"), SLOT(recordMelodySlot()), QKeySequence("Ctrl+Space"),
......
/***************************************************************************
* Copyright (C) 2014 by Tomasz Bojczuk *
* Copyright (C) 2014-2015 by Tomasz Bojczuk *
* tomaszbojczuk@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
......@@ -26,7 +26,7 @@
class QAction;
class QMainWindow;
class QWidgetAction;
class QMenu;
class Tmenu;
class QToolButton;
class TmainScore;
......@@ -59,7 +59,7 @@ private:
TmainScore *m_score;
QWidgetAction *m_melAct;
QToolButton *m_button;
QMenu *m_menu;
Tmenu *m_menu;
QAction *m_playMelAct, *m_recMelAct;
};
......
/***************************************************************************
* Copyright (C) 2015 by Tomasz Bojczuk *
* tomaszbojczuk@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "tmenu.h"
#include <QShowEvent>
/*static*/
int Tmenu::m_yPosOffset = 0;
Tmenu::Tmenu(QWidget* parent) :
QMenu(parent)
{}
void Tmenu::setYOffset(const QWidget* statusLab) {
if (statusLab->isVisible())
m_yPosOffset = statusLab->height() * 1.3;
else
m_yPosOffset = 0;
}
//#################################################################################################
//################### PROTECTED ############################################
//#################################################################################################
void Tmenu::showEvent(QShowEvent* event) {
move(x(), y() + m_yPosOffset);
QWidget::showEvent(event);
}
/***************************************************************************
* Copyright (C) 2015 by Tomasz Bojczuk *
* tomaszbojczuk@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef TMENU_H
#define TMENU_H
#include <QMenu>
/**
* This is ordinary QMenu class but it shifts menu position of @p yPosOffset
* To display menu below Nootka status bar (if it is visible)
*/
class Tmenu : public QMenu
{
public:
explicit Tmenu(QWidget* parent = 0);
/** Checks is given status lab visible and shifts drop down menu position - y coordinate. */
static void setYOffset(const QWidget* statusLab);
protected:
virtual void showEvent(QShowEvent* event);
private:
static int m_yPosOffset;
};
#endif // TMENU_H
......@@ -27,6 +27,7 @@
#include "gui/tmelman.h"
#include "gui/tmainview.h"
#include "gui/ttoolbar.h"
#include "gui/tmenu.h"
#include <tglobals.h>
#include <widgets/troundedlabel.h>
#include <tscoreparams.h>
......@@ -335,6 +336,7 @@ void MainWindow::createSettingsDialog() {
bar->setBarIconStyle(gl->L->iconTextOnToolBar, bar->iconSize().width());
innerWidget->setBarAutoHide(gl->L->toolBarAutoHide);
m_statLab->setVisible(gl->L->hintsBarEnabled);
Tmenu::setYOffset(m_statLab);
pitchView->setVisible(gl->L->soundViewEnabled); // TODO - stop receiving audio signals
guitar->setVisible(gl->L->guitarEnabled); // TODO - delete guitar
m_isPlayerFree = true;
......@@ -647,6 +649,7 @@ void MainWindow::updateSize(QSize newS) {
qreal fact = (qreal)(m_statFontSize * 1.5) / (qreal)fMetr.boundingRect("A").height();
f.setPointSize(f.pointSize() * fact);
m_statLab->setFont(f);
Tmenu::setYOffset(m_statLab);
int newGuitH = (newS.height() - bar->height()) * 0.25;
if (progress) {
progress->resize(m_statFontSize);
......
......@@ -21,13 +21,14 @@
#include "tmainscore.h"
#include <widgets/tpushbutton.h>
#include <tpath.h>
#include <gui/tmenu.h>
#include <QtWidgets>
TscoreActions::TscoreActions(TmainScore* sc) :
QObject(sc),
m_score(sc)
{
m_menu = new QMenu(sc);
m_menu = new Tmenu(sc);
m_button = new QToolButton(sc);
m_button->setIcon(QIcon(Tpath::img("score")));
m_button->setText(tr("Score", "it could be 'notation', 'staff' or whatever is associated with that 'place to display musical notes' and this the name is quite short and looks well."));
......
......@@ -28,7 +28,7 @@
class QIcon;
class QWidgetAction;
class QMenu;
class Tmenu;
class QToolButton;
class QShortcut;
class TscoreKeys;
......@@ -74,7 +74,7 @@ public:
private:
TmainScore *m_score;
QToolButton *m_button;
QMenu *m_menu;
Tmenu *m_menu;
QWidgetAction *m_mainAction;
QAction *m_inZoom, *m_outZoom;
QAction *m_staffDown, *m_staffUp, *m_firstNote ,*m_lastNote, *m_nextNote, *m_prevNote;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment