Set application stylesheet (.css)

Sets the style for LineEdit boxes similarly to the specified design
in issue #117.
This commit is contained in:
deeplow 2022-10-07 14:46:45 +01:00
parent e64954acfa
commit 0e36f8d2eb
No known key found for this signature in database
GPG key ID: 577982871529A52A
2 changed files with 10 additions and 1 deletions

View file

@ -13,6 +13,7 @@ from PySide2 import QtCore, QtGui, QtWidgets
from .. import args, errors from .. import args, errors
from ..document import Document from ..document import Document
from ..util import get_resource_path
from .logic import DangerzoneGui from .logic import DangerzoneGui
from .main_window import MainWindow from .main_window import MainWindow
from .systray import SysTray from .systray import SysTray
@ -29,7 +30,9 @@ class ApplicationWrapper(QtCore.QObject):
super(ApplicationWrapper, self).__init__() super(ApplicationWrapper, self).__init__()
self.app = QtWidgets.QApplication() self.app = QtWidgets.QApplication()
self.app.setQuitOnLastWindowClosed(False) self.app.setQuitOnLastWindowClosed(False)
with open(get_resource_path("dangerzone.css"), "r") as f:
style = f.read()
self.app.setStyleSheet(style)
self.original_event = self.app.event self.original_event = self.app.event
def monkeypatch_event(arg__1: QtCore.QEvent) -> bool: def monkeypatch_event(arg__1: QtCore.QEvent) -> bool:

6
share/dangerzone.css Normal file
View file

@ -0,0 +1,6 @@
QLineEdit {
border-width: 1px;
border-style: solid;
border-color: #c8c8c8 #c8c8c8 white;
padding: 3px;
}