Stylesheet support

print
Josef Rokos 9 years ago
parent 8e999c7818
commit 2bb07716b9

@ -2,5 +2,6 @@
<qresource prefix="/"> <qresource prefix="/">
<file>icons/login_32.png</file> <file>icons/login_32.png</file>
<file>icons/login_64.png</file> <file>icons/login_64.png</file>
<file>style.css</file>
</qresource> </qresource>
</RCC> </RCC>

@ -18,6 +18,13 @@ MainWindow::MainWindow(QWidget *parent) :
m_loginDialog = new LoginDialog(this); m_loginDialog = new LoginDialog(this);
QFile styleFile(":/style.css");
if (styleFile.open(QIODevice::ReadOnly | QIODevice::Text))
{
this->setStyleSheet(styleFile.readAll());
}
connect(m_loginDialog, &LoginDialog::accepted, [this]{ connect(m_loginDialog, &LoginDialog::accepted, [this]{
PermissionService service; PermissionService service;
QSharedPointer<User> u = service.loadUser(m_loginDialog->login()); QSharedPointer<User> u = service.loadUser(m_loginDialog->login());

@ -21,6 +21,9 @@
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QWidget" name="navigation" native="true"> <widget class="QWidget" name="navigation" native="true">
<property name="enabled"> <property name="enabled">
@ -53,7 +56,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1000</width> <width>1000</width>
<height>19</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">

@ -0,0 +1,16 @@
#navigation {
background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255));
}
#navigation QPushButton {
color: black;
border: 1px solid #555;
border-radius: 11px;
padding: 5px;
background: qradialgradient(cx: 0.3, cy: -0.4,
fx: 0.3, fy: -0.4,
radius: 1.35, stop: 0 #e3e67e, stop: 1 #f3f5d0);
min-width: 80px;
min-height: 40px;
font: 14px;
}
Loading…
Cancel
Save