Refactor css, clear path in code.
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
#include <QLabel>
|
||||
#include <qdebug.h>
|
||||
|
||||
#include "guimacros.h"
|
||||
#include "forms/scan/PatientInformationForm.h"
|
||||
#include "event/EventCenter.h"
|
||||
#include "log/UserOperationLog.h"
|
||||
@@ -47,8 +46,7 @@ ScanFormWidget::ScanFormWidget(QWidget* parent)
|
||||
, mLblE2(new QLabel(this))
|
||||
{
|
||||
|
||||
auto layout = new QHBoxLayout();
|
||||
ui->commandWidget->setLayout(layout);
|
||||
auto layout = new QHBoxLayout(ui->commandWidget);
|
||||
initProtocolUI(layout);
|
||||
layout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
||||
addVerticalLine(layout);
|
||||
@@ -64,12 +62,14 @@ void ScanFormWidget::initProtocolUI(QHBoxLayout *layout) {
|
||||
mLblProtocol->setObjectName("protocolPanelTitle");
|
||||
layout->addWidget(mLblProtocol);
|
||||
addVerticalLine(layout);
|
||||
INIT_TOOL_BTN(Left, ":/icons/left.png")
|
||||
INIT_TOOL_BTN(Right, ":/icons/right.png")
|
||||
mBtnLeft->setObjectName("btnLeft");
|
||||
mBtnRight->setObjectName("btnRight");
|
||||
mBtnLeft->setText(tr("LEFT"));
|
||||
mBtnRight->setText(tr("RIGHT"));
|
||||
layout->addWidget(mBtnLeft);
|
||||
layout->addWidget(mBtnRight);
|
||||
|
||||
auto group = new QButtonGroup(this);
|
||||
auto group = new QButtonGroup(ui->commandWidget);
|
||||
mBtnLeft->setCheckable(true);
|
||||
mBtnLeft->setChecked(true);
|
||||
mBtnRight->setCheckable(true);
|
||||
@@ -120,11 +120,10 @@ void ScanFormWidget::initScanContent() {
|
||||
}
|
||||
|
||||
void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
|
||||
INIT_TOOL_BTN(Refresh, ":/icons/scan_e.png")
|
||||
INIT_TOOL_BTN(Preview, ":/icons/rec.png")
|
||||
|
||||
INIT_TOOL_BTN(Stop, ":/icons/stop.png")
|
||||
INIT_TOOL_BTN(Scan, ":/icons/scan.png")
|
||||
mBtnRefresh->setObjectName("btnRefresh");
|
||||
mBtnPreview->setObjectName("btnPreview");
|
||||
mBtnStop->setObjectName("btnStop");
|
||||
mBtnScan->setObjectName("btnScan");
|
||||
|
||||
mBtnRefresh->setText(tr("Refresh"));
|
||||
mBtnPreview->setText(tr("Preview"));
|
||||
@@ -135,6 +134,11 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
|
||||
mBtnRefresh->setEnabled(false);
|
||||
mBtnPreview->setEnabled(false);
|
||||
mBtnStop->setEnabled(false);
|
||||
|
||||
layout->addWidget(mBtnScan);
|
||||
layout->addWidget(mBtnRefresh);
|
||||
layout->addWidget(mBtnPreview);
|
||||
layout->addWidget(mBtnStop);
|
||||
connect(mBtnRefresh, &QToolButton::clicked, [=]() {
|
||||
QString patientInf(mPatInf->getCurrentPatientJsonString(true));
|
||||
LOG_USER_OPERATION(StartRefresh)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "components/SlideTableView.h"
|
||||
#include "db/SQLHelper.h"
|
||||
#include "guimacros.h"
|
||||
#include "event/EventCenter.h"
|
||||
#include "dialogs/AccountFormDialog.h"
|
||||
#include "dialogs/AlertDialog.h"
|
||||
@@ -77,10 +76,12 @@ void SelectFormWidget::prepareButtons(bool disableALL) {
|
||||
}
|
||||
|
||||
void SelectFormWidget::initGeneralButtons(QHBoxLayout *layout) {
|
||||
INIT_TOOL_BTN(Account, ":/icons/account.png")
|
||||
INIT_TOOL_BTN(Worklist, ":/icons/setting.png")
|
||||
mBtnAccount->setObjectName("btnAccount");
|
||||
mBtnWorklist->setObjectName("btnWorklist");
|
||||
mBtnAccount->setText(tr("Account"));
|
||||
mBtnWorklist->setText(tr("Worklist"));
|
||||
layout->addWidget(mBtnAccount);
|
||||
layout->addWidget(mBtnWorklist);
|
||||
// mBtn account slot
|
||||
connect(mBtnAccount, &QToolButton::clicked, [=]() {
|
||||
AccountFormDialog dialog(this);
|
||||
@@ -90,14 +91,18 @@ void SelectFormWidget::initGeneralButtons(QHBoxLayout *layout) {
|
||||
}
|
||||
|
||||
void SelectFormWidget::initPatEditButtons(QHBoxLayout *layout) {
|
||||
INIT_TOOL_BTN(Add, ":/icons/add.png")
|
||||
INIT_TOOL_BTN(Edit, ":/icons/details.png")
|
||||
INIT_TOOL_BTN(Delete, ":/icons/close_circle.png")
|
||||
INIT_TOOL_BTN(Select, ":/icons/selected.png")
|
||||
mBtnAdd->setObjectName("btnAdd");
|
||||
mBtnEdit->setObjectName("btnEdit");
|
||||
mBtnDelete->setObjectName("btnDelete");
|
||||
mBtnSelect->setObjectName("btnSelect");
|
||||
mBtnAdd->setText(tr("Add"));
|
||||
mBtnEdit->setText(tr("Edit"));
|
||||
mBtnDelete->setText(tr("Delete"));
|
||||
mBtnSelect->setText(tr("Select"));
|
||||
layout->addWidget(mBtnAdd);
|
||||
layout->addWidget(mBtnEdit);
|
||||
layout->addWidget(mBtnDelete);
|
||||
layout->addWidget(mBtnSelect);
|
||||
|
||||
// btn add & edit slot
|
||||
connect(mBtnAdd, &QToolButton::clicked, this, &SelectFormWidget::editPatient);
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "components/SlideTableView.h"
|
||||
#include "dialogs/AccountFormDialog.h"
|
||||
#include "event/EventCenter.h"
|
||||
#include "guimacros.h"
|
||||
|
||||
AccountTableForm::AccountTableForm(QWidget* aParent)
|
||||
: QWidget(aParent)
|
||||
@@ -56,7 +55,7 @@ AccountTableForm::AccountTableForm(QWidget* aParent)
|
||||
table->setColumnWidth(4, 150);
|
||||
|
||||
QWidget* cmdPanel = new QWidget(this);
|
||||
cmdPanel->setObjectName("commandWidgetnoBBorder");
|
||||
cmdPanel->setObjectName("commandWidget");
|
||||
QHBoxLayout* cmdLayout = new QHBoxLayout(cmdPanel);
|
||||
|
||||
cmdLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
|
||||
@@ -64,9 +63,15 @@ AccountTableForm::AccountTableForm(QWidget* aParent)
|
||||
spacerLine->setFixedWidth(2);
|
||||
spacerLine->setObjectName("verSpaceLine");
|
||||
cmdLayout->addWidget(spacerLine);
|
||||
ADD_TOOL_BTN_TO_LAYOUT(Add, ":/icons/add.png", cmdLayout);
|
||||
ADD_TOOL_BTN_TO_LAYOUT(Edit, ":/icons/details.png", cmdLayout);
|
||||
ADD_TOOL_BTN_TO_LAYOUT(Delete, ":/icons/close_circle.png", cmdLayout);
|
||||
auto btnAdd = new QToolButton(this);
|
||||
btnAdd->setObjectName("btnAdd");
|
||||
cmdLayout->addWidget(btnAdd);
|
||||
auto btnEdit = new QToolButton(this);
|
||||
btnEdit->setObjectName("btnEdit");
|
||||
cmdLayout->addWidget(btnEdit);
|
||||
auto btnDelete = new QToolButton(this);
|
||||
btnDelete->setObjectName("btnDelete");
|
||||
cmdLayout->addWidget(btnDelete);
|
||||
btnAdd->setText(tr("Add"));
|
||||
btnEdit->setText(tr("Edit"));
|
||||
btnDelete->setText(tr("Delete"));
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
//
|
||||
// Created by Krad on 2021/10/8.
|
||||
//
|
||||
|
||||
#ifndef GUI_GUIMACROS_H
|
||||
#define GUI_GUIMACROS_H
|
||||
#define ADD_TOOL_SIZE_BTN_TO_LAYOUT(name,img,size,layout)\
|
||||
QToolButton* btn##name= new QToolButton(this);\
|
||||
btn##name->setToolButtonStyle(Qt::ToolButtonIconOnly);\
|
||||
btn##name->setIcon(QIcon(img));\
|
||||
btn##name->setIconSize(QSize(size,size));\
|
||||
btn##name->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);\
|
||||
layout->addWidget(btn##name);
|
||||
|
||||
#define ADD_TOOL_BTN_TO_LAYOUT(name,img,layout)\
|
||||
ADD_TOOL_SIZE_BTN_TO_LAYOUT(name,img,120,layout)
|
||||
|
||||
|
||||
#define ADD_TOOL_BTN(name,img)\
|
||||
ADD_TOOL_BTN_TO_LAYOUT(name,img,layout)
|
||||
|
||||
#define INIT_TOOL_SIZE_BTN_TO_LAYOUT(name,img,size,layout)\
|
||||
mBtn##name->setToolButtonStyle(Qt::ToolButtonIconOnly);\
|
||||
mBtn##name->setIcon(QIcon(img));\
|
||||
mBtn##name->setIconSize(QSize(size,size));\
|
||||
mBtn##name->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);\
|
||||
layout->addWidget(mBtn##name);
|
||||
|
||||
#define INIT_TOOL_BTN_TO_LAYOUT(name,img,layout)\
|
||||
INIT_TOOL_SIZE_BTN_TO_LAYOUT(name,img,120,layout)
|
||||
|
||||
|
||||
#define INIT_TOOL_BTN(name,img)\
|
||||
INIT_TOOL_BTN_TO_LAYOUT(name,img,layout)
|
||||
#endif //GUI_GUIMACROS_H
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Global */
|
||||
/*------Global---------------------------------------------------------------*/
|
||||
* {
|
||||
background-color: #3c3c3c;
|
||||
color: #fcfcfc;
|
||||
@@ -146,7 +146,8 @@ QTabBar::tab:selected, QTabBar::tab:hover {
|
||||
}
|
||||
|
||||
QTabWidget::pane {
|
||||
margin: 0
|
||||
margin: 0;
|
||||
border-bottom: 1px solid #323232;
|
||||
}
|
||||
|
||||
/* Global TableView & ListView */
|
||||
@@ -155,7 +156,7 @@ QTableView {
|
||||
alternate-background-color: #595959;
|
||||
selection-color: #fcfcfc;
|
||||
selection-background-color: #0078d8;
|
||||
margin: 5px 0 5 5;
|
||||
margin: 5 0 5 5;
|
||||
}
|
||||
|
||||
QListView {
|
||||
@@ -292,6 +293,9 @@ QDialog#loginForm QToolButton#btnlogin {
|
||||
font-size: 26px;
|
||||
font-weight: Bold;
|
||||
padding: 5px;
|
||||
qproperty-icon:url(":/icons/login.png");
|
||||
qproperty-toolButtonStyle:ToolButtonTextBesideIcon;
|
||||
qproperty-iconSize:120px 120px;
|
||||
}
|
||||
|
||||
QDialog#loginForm QToolButton#btnlogin:hover {
|
||||
@@ -368,7 +372,12 @@ QWidget#commandWidget {
|
||||
min-height: 123px;
|
||||
max-height: 123px;
|
||||
border-top: 1px solid #505050;
|
||||
border-bottom: 1px solid #323232;
|
||||
|
||||
}
|
||||
|
||||
QWidget#commandWidget QToolButton{
|
||||
qproperty-toolButtonStyle:ToolButtonTextBesideIcon;
|
||||
qproperty-iconSize:120px 120px;
|
||||
}
|
||||
|
||||
/*------SelectformWidget-----------------------------------------------------*/
|
||||
@@ -408,6 +417,7 @@ QToolButton#hideeditBtn {
|
||||
qproperty-icon:url(":/icons/hidearrow.png");
|
||||
qproperty-iconSize:30px 30px;
|
||||
}
|
||||
|
||||
/* PatientDetailForm in SelectformWidget */
|
||||
QWidget#editcmdWidget {
|
||||
min-height: 83px;
|
||||
@@ -420,6 +430,30 @@ QLineEdit#displayLineEdit:disabled {
|
||||
color: #fcfcfc;
|
||||
}
|
||||
|
||||
QWidget#commandWidget QToolButton#btnAccount {
|
||||
qproperty-icon:url(":/icons/account.png");
|
||||
}
|
||||
|
||||
QToolButton#btnWorklist {
|
||||
qproperty-icon:url(":/icons/setting.png");
|
||||
}
|
||||
|
||||
QToolButton#btnAdd {
|
||||
qproperty-icon:url(":/icons/add.png");
|
||||
}
|
||||
|
||||
QToolButton#btnEdit {
|
||||
qproperty-icon:url(":/icons/details.png");
|
||||
}
|
||||
|
||||
QToolButton#btnDelete {
|
||||
qproperty-icon:url(":/icons/close_circle.png");
|
||||
}
|
||||
|
||||
QToolButton#btnSelect {
|
||||
qproperty-icon:url(":/icons/selected.png");
|
||||
}
|
||||
|
||||
/*------ScanFormWidget-------------------------------------------------------*/
|
||||
QWidget#paramWidget {
|
||||
min-width: 300px;
|
||||
@@ -433,12 +467,6 @@ QWidget#broadcastWidget {
|
||||
background-color: black
|
||||
}
|
||||
|
||||
QWidget#PatientInformationForm {
|
||||
min-width: 300px;
|
||||
max-width: 300px;
|
||||
margin-right: 10
|
||||
}
|
||||
|
||||
QLabel#protocolPanelTitle {
|
||||
font-size: 32px;
|
||||
margin: 0;
|
||||
@@ -469,36 +497,63 @@ QWidget#broadcastWidget QLabel {
|
||||
background-color: black
|
||||
}
|
||||
|
||||
QWidget#PatientInformationForm {
|
||||
min-width: 300px;
|
||||
max-width: 300px;
|
||||
margin-right: 10
|
||||
}
|
||||
|
||||
/* PatientInfomationForm in ScanFormWidget */
|
||||
QWidget#patientInfoPanel {
|
||||
border-right: 1px solid #0078d8
|
||||
}
|
||||
|
||||
/* protocol buttons in ScanFormWidget*/
|
||||
QToolButton#sexBtn {
|
||||
min-width: 120px;
|
||||
max-width: 120px;
|
||||
font-size: 20px;
|
||||
padding: 2px;
|
||||
QToolButton#btnLeft {
|
||||
qproperty-icon:url(":/icons/left.png");
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
QToolButton#sexBtn:checked {
|
||||
border: 2px solid darkorange;
|
||||
QToolButton#btnLeft:checked {
|
||||
border: 5px solid darkorange;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
QToolButton#btnRight {
|
||||
qproperty-icon:url(":/icons/right.png");
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
QToolButton#btnRight:checked {
|
||||
border: 5px solid darkorange;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
QToolButton#btnRefresh {
|
||||
qproperty-icon:url(":/icons/scan_e.png");
|
||||
}
|
||||
|
||||
QToolButton#btnPreview {
|
||||
qproperty-icon:url(":/icons/rec.png");
|
||||
}
|
||||
|
||||
QToolButton#btnStop {
|
||||
qproperty-icon:url(":/icons/stop.png");
|
||||
}
|
||||
|
||||
QToolButton#btnScan {
|
||||
qproperty-icon:url(":/icons/scan.png");
|
||||
}
|
||||
|
||||
/*------AdminSettingForm---------------------------------------------------*/
|
||||
QWidget#settingContentWidget {
|
||||
border-top: 1px solid #505050;
|
||||
border-bottom: 1px solid #323232;
|
||||
}
|
||||
|
||||
QWidget#settingContentWidget QStackedWidget{
|
||||
margin-top: 5;
|
||||
margin-bottom: 5
|
||||
}
|
||||
|
||||
/*------AboutWidget----------------------------------------------------------*/
|
||||
/*------AboutForm----------------------------------------------------------*/
|
||||
QLabel#normal {
|
||||
color: #fcfcfc;
|
||||
font-weight: normal;
|
||||
@@ -523,6 +578,7 @@ QWidget#commandWidgetnoBBorder {
|
||||
border-top: 1px solid #505050;
|
||||
}
|
||||
|
||||
/*------Dialogs--------------------------------------------------------------*/
|
||||
|
||||
/*------GUIFormBaseDialog----------------------------------------------------*/
|
||||
QDialog#formDialog {
|
||||
@@ -556,7 +612,7 @@ QPushButton#btnOK {
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
/* GUIFormBaseDialog - AccountFormDialog */
|
||||
/* GUIFormBaseDialog -> AccountFormDialog */
|
||||
QToolButton#changePwdBtn{
|
||||
qproperty-icon:url(":/icons/edit.png");
|
||||
}
|
||||
@@ -606,6 +662,8 @@ QToolButton#dialogBtnStop{
|
||||
qproperty-icon:url(":/icons/close_circle_d.png");
|
||||
}
|
||||
|
||||
/*-------Conponts-------------------------------------------------------------*/
|
||||
|
||||
/*------SlidePickerBox--------------------------------------------------------*/
|
||||
QWidget#slidePicker {
|
||||
border: 1px solid #505050;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <QToolButton>
|
||||
#include <QtWidgets/QLabel>
|
||||
|
||||
#include "guimacros.h"
|
||||
#include "event/EventCenter.h"
|
||||
#include "models/User.h"
|
||||
#include "log/UserOperationLog.h"
|
||||
@@ -100,12 +99,13 @@ void LoginDialog::initializeEdit()
|
||||
|
||||
void LoginDialog::initializeLoginButton()
|
||||
{
|
||||
ADD_TOOL_BTN_TO_LAYOUT(login, ":/icons/login.png", mDialogContentsLayout)
|
||||
btnlogin->setText(tr("Login"));
|
||||
mDialogContentsLayout->removeWidget(btnlogin);
|
||||
mDialogContentsLayout->addWidget(btnlogin, 0, Qt::AlignCenter);
|
||||
mLoginButton = btnlogin;
|
||||
btnlogin->setObjectName("btnlogin");
|
||||
auto btnLogin = new QToolButton(this);
|
||||
btnLogin->setObjectName("btnlogin");
|
||||
mDialogContentsLayout->addWidget(btnLogin);
|
||||
btnLogin->setText(tr("Login"));
|
||||
mDialogContentsLayout->removeWidget(btnLogin);
|
||||
mDialogContentsLayout->addWidget(btnLogin, 0, Qt::AlignCenter);
|
||||
mLoginButton = btnLogin;
|
||||
connect(mLoginButton, SIGNAL(clicked()), this, SLOT(doLogin()));
|
||||
}
|
||||
|
||||
@@ -135,9 +135,11 @@ void LoginDialog::doLogin()
|
||||
QString encryptPwd = User::getEncryptedPassword(strPassWord);
|
||||
if (User::QueryUser(strUserCode, encryptPwd))
|
||||
{
|
||||
mErrorMessage->setVisible(false);
|
||||
accept();
|
||||
LOG_USER_OPERATION(Login);
|
||||
JsonObject::Instance()->setDefaultUser(strUserCode);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user