Skip to content

Commit

Permalink
0.4.2.725
Browse files Browse the repository at this point in the history
- info widget close event fixed
  • Loading branch information
xodj committed Jul 9, 2021
1 parent a8b7344 commit 35b2387
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16.0)
#Project name and version
PROJECT(RyzenAdjCtrl VERSION 0.4.2.723 LANGUAGES CXX)
PROJECT(RyzenAdjCtrl VERSION 0.4.2.725 LANGUAGES CXX)
#Set version number in this ^^^^^^^^^
#BUILD_STANDALONE on UNIX or choose on Windows
if(WIN32)
Expand Down Expand Up @@ -43,6 +43,7 @@ set(RyzenAdjCtrl_HEADERS
CtrlComboBox.h
CtrlBus.h
CtrlACCallback.h
CtrlFrame.h
)
set(RyzenAdjCtrl_SOURCES
CtrlGui.cpp
Expand Down
23 changes: 23 additions & 0 deletions CtrlFrame.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef CTRLFRAME_H
#define CTRLFRAME_H

#include <QFrame>

class CtrlFrame : public QFrame
{
Q_OBJECT
public:
explicit CtrlFrame(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags())
: QFrame(parent, f){}
~CtrlFrame(){}

signals:
void closeClicked();

protected:
virtual void closeEvent(QCloseEvent *event) {
emit closeClicked();
}
};

#endif // CTRLFRAME_H
5 changes: 2 additions & 3 deletions CtrlGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ void CtrlGui::setupUi(){

QScroller::grabGesture(ui->scrollArea, QScroller::LeftMouseButtonGesture);

infoFrame = new QFrame(this, Qt::Window);
infoFrame = new CtrlFrame(this, Qt::Window);
ui_infoWidget->setupUi(infoFrame);
infoFrame->setWindowFlag(Qt::WindowMinMaxButtonsHint, false);
//Need to add feature disable updates while hidden
infoFrame->setWindowFlag(Qt::WindowCloseButtonHint, false);
infoFrame->setWindowTitle("RyzenAdj - Info");
infoFrame->setAccessibleName("CtrlInfo");
infoFrame->resize(1,1);
Expand Down Expand Up @@ -171,6 +169,7 @@ void CtrlGui::setupUi(){
void CtrlGui::setupConnections(){
connect(ui->comboBox, &QComboBox::currentTextChanged, this, &CtrlGui::languageChange);
connect(ui->infoPushButton, &QPushButton::clicked, this, &CtrlGui::infoPushButtonClicked);
connect(infoFrame, &CtrlFrame::closeClicked, this, &CtrlGui::infoPushButtonClicked);
connect(ui->settingsPushButton, &QPushButton::clicked, this, &CtrlGui::settingsPushButtonClicked);

connect(tabPlusButton, &QPushButton::clicked, this, &CtrlGui::presetPlusPushButtonClicked);
Expand Down
3 changes: 2 additions & 1 deletion CtrlGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "CtrlSettings.h"
#include "CtrlAgent.h"
#include "CtrlBus.h"
#include "CtrlFrame.h"

QT_BEGIN_NAMESPACE
namespace Ui { class CtrlGui;
Expand Down Expand Up @@ -75,7 +76,7 @@ class CtrlGui : public QMainWindow
Ui::CtrlGuiSettings *ui_settings;
Ui::CtrlInfoWidget *ui_infoWidget;
QFrame *settingFrame;
QFrame *infoFrame;
CtrlFrame *infoFrame;
QTranslator *qtLanguageTranslator;
CtrlBus *bus;
CtrlSettings *conf;
Expand Down

0 comments on commit 35b2387

Please sign in to comment.