Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 84e10d51 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

UI: A much better close button

parent f08e1913
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!10UI improvements
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
using namespace Vivy; using namespace Vivy;
MainWindow::MainWindow() noexcept MainWindow::MainWindow() noexcept
: Window(QIcon(":icons/vivy.png"), "Vivy") : Window(QIcon(VIVY_ICON_APP), "Vivy")
{ {
/* Some declarations */ /* Some declarations */
DCL_MENU(file, "&File"); DCL_MENU(file, "&File");
......
...@@ -19,7 +19,7 @@ TitleBar::TitleBar(const QIcon &icon, const QString &title, QWidget *parent) noe ...@@ -19,7 +19,7 @@ TitleBar::TitleBar(const QIcon &icon, const QString &title, QWidget *parent) noe
auto *iconLabel = new QLabel(this); // Index 0 auto *iconLabel = new QLabel(this); // Index 0
titleLabel = new QLabel("<h2>" + title + "</h2>", this); // Index 1 titleLabel = new QLabel("<h2>" + title + "</h2>", this); // Index 1
auto *closeButton = new QPushButton(parent == nullptr ? "Quit" : "Close", this); auto *closeButton = new QPushButton(this);
connect(closeButton, &QAbstractButton::clicked, this, connect(closeButton, &QAbstractButton::clicked, this,
[=, this]() noexcept -> void { emit closed(); }); [=, this]() noexcept -> void { emit closed(); });
...@@ -30,15 +30,9 @@ TitleBar::TitleBar(const QIcon &icon, const QString &title, QWidget *parent) noe ...@@ -30,15 +30,9 @@ TitleBar::TitleBar(const QIcon &icon, const QString &title, QWidget *parent) noe
closeButton->setFlat(true); closeButton->setFlat(true);
closeButton->setDefault(false); closeButton->setDefault(false);
closeButton->setStyleSheet("color: #1394B4;" closeButton->setStyleSheet("color: #1394B4;"
"font-size: 14px;" "border: none;"
"border-color: #1394B4;" "icon: url(" VIVY_ICON_CLOSE ");"
"border-width: 1px;" "icon-size: 22px;");
"border-radius: 2px;"
"padding-top: 2px;"
"padding-bottom: 2px;"
"padding-left: 5px;"
"padding-right: 5px;"
"border-style: solid;");
titleLayout->addWidget(iconLabel); titleLayout->addWidget(iconLabel);
titleLayout->addWidget(titleLabel); titleLayout->addWidget(titleLabel);
......
...@@ -145,7 +145,7 @@ VivyDocumentView::closeDocument() noexcept ...@@ -145,7 +145,7 @@ VivyDocumentView::closeDocument() noexcept
QIcon QIcon
VivyDocumentView::getDocumentTabIcon() const noexcept VivyDocumentView::getDocumentTabIcon() const noexcept
{ {
return QIcon(":/icons/vivy.png"); return QIcon(VIVY_ICON_APP);
} }
void void
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter