1
0
Fork 0

GUI: fixed a bug with the TimeWastedCounter (it would flicker the menus), just moved it to another place + removed the status bar size handle (for better looks when not maximized)

This commit is contained in:
Mr. eXoDia 2015-08-15 13:19:44 +02:00
parent 2d670c14ea
commit c6c49c8102
4 changed files with 16 additions and 11 deletions

View File

@ -23,11 +23,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
buildInfo->setEnabled(false);
ui->menuBar->addAction(buildInfo);
//time wasted counter
QAction* timeWastedLabel = new QAction(this);
ui->menuBar->addAction(timeWastedLabel);
mTimeWastedCounter = new TimeWastedCounter(this, timeWastedLabel);
//setup bridge signals
connect(Bridge::getBridge(), SIGNAL(updateWindowTitle(QString)), this, SLOT(updateWindowTitleSlot(QString)));
connect(Bridge::getBridge(), SIGNAL(addRecentFile(QString)), this, SLOT(addRecentFile(QString)));
@ -171,6 +166,11 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
mLastLogLabel = new StatusLabel();
ui->statusBar->addPermanentWidget(mLastLogLabel, 1);
//time wasted counter
QLabel* timeWastedLabel = new QLabel(this);
ui->statusBar->addPermanentWidget(timeWastedLabel);
mTimeWastedCounter = new TimeWastedCounter(this, timeWastedLabel);
mPatchDialog = new PatchDialog(this);
mCalculatorDialog = new CalculatorDialog(this);
connect(mCalculatorDialog, SIGNAL(showCpu()), this, SLOT(displayCpuWidget()));

View File

@ -174,7 +174,11 @@
<addaction name="actionReportBug"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QStatusBar" name="statusBar">
<property name="sizeGripEnabled">
<bool>false</bool>
</property>
</widget>
<widget class="QToolBar" name="cmdBar">
<property name="windowTitle">
<string>toolBar</string>

View File

@ -1,10 +1,11 @@
#include "TimeWastedCounter.h"
#include "Bridge.h"
TimeWastedCounter::TimeWastedCounter(QObject* parent, QAction* label)
TimeWastedCounter::TimeWastedCounter(QObject* parent, QLabel* label)
: QObject(parent), mLabel(label)
{
mLabel->setEnabled(false);
mLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); //sunken style
mLabel->setStyleSheet("QLabel { background-color : #c0c0c0; }");
connect(Bridge::getBridge(), SIGNAL(updateTimeWastedCounter()), this, SLOT(updateTimeWastedCounter()));
}

View File

@ -2,19 +2,19 @@
#define TIMEWASTEDCOUNTER_H
#include <QObject>
#include <QAction>
#include <QLabel>
class TimeWastedCounter : public QObject
{
Q_OBJECT
public:
explicit TimeWastedCounter(QObject* parent, QAction* label);
explicit TimeWastedCounter(QObject* parent, QLabel* label);
private slots:
void updateTimeWastedCounter();
private:
QAction* mLabel;
QLabel* mLabel;
};
#endif // TIMEWASTEDCOUNTER_H