generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make buttons blue when clickable and gray when not clickable
- Loading branch information
1 parent
4116775
commit ebc03db
Showing
8 changed files
with
105 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,6 @@ compile_commands.json | |
*creator.user* | ||
|
||
.DS_Store | ||
|
||
# Vscode configurations | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "minikubebutton.h" | ||
|
||
MinikubeButton::MinikubeButton(QWidget *parent) : QPushButton(parent) | ||
{ | ||
// By default a button is enabled when instantiated | ||
setStyleSheet(enabledStyleSheet); | ||
} | ||
|
||
MinikubeButton::MinikubeButton(const QString &text, QWidget *parent) : QPushButton(text, parent) | ||
{ | ||
setStyleSheet(enabledStyleSheet); | ||
} | ||
|
||
MinikubeButton::MinikubeButton(const QIcon &icon, const QString &text, QWidget *parent) | ||
: QPushButton(icon, text, parent) | ||
{ | ||
setStyleSheet(enabledStyleSheet); | ||
} | ||
|
||
void MinikubeButton::setEnabled(bool enabled) | ||
{ | ||
QPushButton::setEnabled(enabled); | ||
setStyleSheet(enabled ? enabledStyleSheet : diabledStyleSheet); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef MINIKUBEBUTTON_H | ||
#define MINIKUBEBUTTON_H | ||
#include <QPushButton> | ||
|
||
class MinikubeButton : public QPushButton | ||
{ | ||
public: | ||
explicit MinikubeButton(QWidget *parent = nullptr); | ||
explicit MinikubeButton(const QString &text, QWidget *parent = nullptr); | ||
MinikubeButton(const QIcon &icon, const QString &text, QWidget *parent = nullptr); | ||
|
||
void setEnabled(bool enabled); | ||
|
||
private: | ||
const QString enabledStyleSheet = "QPushButton:hover{background-color:rgb(105,192,255,50);" | ||
"border-radius: 2px;border: 1px solid rgb(124, 124, 124)}"; | ||
const QString diabledStyleSheet = | ||
"QPushButton{background-color:rgb(191,191,191,50);color:rgb(140,140,140);}"; | ||
}; | ||
|
||
#endif // MINIKUBEBUTTON_H |