[arch] improvement -> 'keep' as the default button for 'no longer needed deps' dialog | [ui] adding missing 'pointing hand' cursors

This commit is contained in:
Vinicius Moreira
2020-09-05 23:52:26 -03:00
parent faa8cc4e0d
commit bf6361a6d1
11 changed files with 20 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
from typing import List
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QMessageBox, QVBoxLayout, QLabel, QWidget, QScrollArea, QFrame
from bauh.api.abstract.view import ViewComponent
@@ -25,11 +26,13 @@ class ConfirmationDialog(QMessageBox):
self.bt_yes = None
if confirmation_button:
self.bt_yes = self.addButton(i18n['popup.button.yes'] if not confirmation_label else confirmation_label.capitalize(), QMessageBox.YesRole)
self.bt_yes.setCursor(QCursor(Qt.PointingHandCursor))
self.bt_yes.setStyleSheet(css.OK_BUTTON)
self.setDefaultButton(self.bt_yes)
if deny_button:
self.bt_no = self.addButton(i18n['popup.button.no'] if not deny_label else deny_label.capitalize(), QMessageBox.NoRole)
self.bt_no.setCursor(QCursor(Qt.PointingHandCursor))
if not confirmation_button:
self.bt_no.setStyleSheet(css.OK_BUTTON)

View File

@@ -1,7 +1,7 @@
from typing import List
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtGui import QIcon, QCursor
from PyQt5.QtWidgets import QMessageBox, QLabel, QWidget, QHBoxLayout
from bauh.api.abstract.view import MessageType
@@ -47,9 +47,11 @@ def ask_confirmation(title: str, body: str, i18n: I18n, icon: QIcon = QIcon(reso
bt_yes = diag.addButton(i18n['popup.button.yes'], QMessageBox.YesRole)
bt_yes.setStyleSheet(css.OK_BUTTON)
bt_yes.setCursor(QCursor(Qt.PointingHandCursor))
diag.setDefaultButton(bt_yes)
diag.addButton(i18n['popup.button.no'], QMessageBox.NoRole)
bt_no = diag.addButton(i18n['popup.button.no'], QMessageBox.NoRole)
bt_no.setCursor(QCursor(Qt.PointingHandCursor))
if icon:
diag.setWindowIcon(icon)