From d31be130fbb4b1da93899fbe5114fcc7e1a72369 Mon Sep 17 00:00:00 2001 From: duanshengchao <519970194@qq.com> Date: Tue, 10 Jun 2025 11:22:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AF=E4=BB=B6=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E4=B8=BA=E9=BB=91=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/multiLineHeaderView.h | 2 +- resource/PowerModeler.qrc | 8 + resource/images/btn_close_default.png | Bin 178 -> 187 bytes resource/images/darkstyle/branch_closed.png | Bin 0 -> 188 bytes resource/images/darkstyle/branch_open.png | Bin 0 -> 186 bytes resource/images/darkstyle/down-arrow.png | Bin 0 -> 246 bytes .../toolbar_separator_horizontal.png | Bin 0 -> 145 bytes .../darkstyle/toolbar_separator_vertical.png | Bin 0 -> 133 bytes resource/images/darkstyle/up-arrow.png | Bin 0 -> 249 bytes resource/images/icon_close.png | Bin 290 -> 324 bytes resource/images/icon_done.png | Bin 335 -> 398 bytes resource/images/icon_ellipsis.png | Bin 293 -> 217 bytes resource/images/icon_first.png | Bin 208 -> 237 bytes resource/images/icon_last.png | Bin 214 -> 234 bytes resource/images/icon_multiple-choice.png | Bin 332 -> 381 bytes resource/images/icon_next.png | Bin 268 -> 273 bytes resource/images/icon_plus.png | Bin 156 -> 169 bytes resource/images/icon_previous.png | Bin 237 -> 267 bytes resource/images/icon_refresh3.png | Bin 485 -> 576 bytes resource/images/icon_refresh3_disable.png | Bin 582 -> 592 bytes resource/images/icon_subtract.png | Bin 128 -> 140 bytes source/attributeSelector.cpp | 2 +- source/attributeTableDelegate.cpp | 24 ++- source/attributeView.cpp | 4 +- source/connectionDialog.cpp | 2 +- source/groupSelectionDialog.cpp | 2 +- source/main.cpp | 2 + source/maskLayer.cpp | 2 +- source/messageBox.cpp | 2 +- source/messageDialog.cpp | 2 +- source/modelInfoEditDialog.cpp | 6 +- source/multiLineHeaderView.cpp | 3 +- ui/attributeSelector.ui | 22 +-- ui/connectionDialog.ui | 10 +- ui/dbBrowser.ui | 17 +- ui/mainwindow.ui | 161 ++++++++++++++++-- ui/modelInfoEditDialog.ui | 4 +- ui/textEditWidget.ui | 52 +++--- 38 files changed, 229 insertions(+), 98 deletions(-) create mode 100644 resource/images/darkstyle/branch_closed.png create mode 100644 resource/images/darkstyle/branch_open.png create mode 100644 resource/images/darkstyle/down-arrow.png create mode 100644 resource/images/darkstyle/toolbar_separator_horizontal.png create mode 100644 resource/images/darkstyle/toolbar_separator_vertical.png create mode 100644 resource/images/darkstyle/up-arrow.png diff --git a/include/multiLineHeaderView.h b/include/multiLineHeaderView.h index 4d41e90..b662324 100644 --- a/include/multiLineHeaderView.h +++ b/include/multiLineHeaderView.h @@ -6,7 +6,7 @@ struct HeaderLineStyle { QFont font = QFont("Microsoft YaHei", 9); - QColor color = QColor(26, 26, 26); + QColor color = QColor(240, 240, 240); Qt::Alignment alignment = Qt::AlignLeft; }; diff --git a/resource/PowerModeler.qrc b/resource/PowerModeler.qrc index 35558b4..fdf2764 100644 --- a/resource/PowerModeler.qrc +++ b/resource/PowerModeler.qrc @@ -64,4 +64,12 @@ images/icon_db_connect.png images/icon_db_disconnect.png + + images/darkstyle/toolbar_separator_horizontal.png + images/darkstyle/branch_closed.png + images/darkstyle/branch_open.png + images/darkstyle/down-arrow.png + images/darkstyle/toolbar_separator_vertical.png + images/darkstyle/up-arrow.png + diff --git a/resource/images/btn_close_default.png b/resource/images/btn_close_default.png index 76de3059e7e70586bde9623b28496c51ccaae2fd..0aa446a8ec9935a7f9e4d26aa29b00df4bfc0170 100644 GIT binary patch delta 138 zcmV;50CoSe0lNW^Ie%?QL_t(|oXwIk4uCKW19=!y5zpj>l)=|0piB&;O;Lp)ONN{+ zIr239W=biWq!e+$V(jf8DFL}RoV+IQOdwE$VEAS*|d2^fZGqOa|m i$Jl#jj^)1cH#z~xy&i%Oszv}V7(EYJ$d?p=^gRH+5E=OtsA&x94u>hEctnx@x!MN)pKMuY-NqFhBMSHDji}uKA%b#e_yndoVyZ*!sw)GP;`2MS1suj`8lLKzn>H?dc;I(bi9-VeBNGdU kfC8A2@x^$Tzev1!#y8g1sT(fm1C3+wboFyt=akR{0P#vJF8}}l literal 0 HcmV?d00001 diff --git a/resource/images/darkstyle/toolbar_separator_vertical.png b/resource/images/darkstyle/toolbar_separator_vertical.png new file mode 100644 index 0000000000000000000000000000000000000000..4dde3f37f145f0723062766bcad7f0f9af4f9f1d GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3**C5OoFy%!JP|)1d z#W5tJ_3hb(f(!~g2M!!aktln`A=_mg=B&8U^hs!p!=xqmw@M3cYz+JoJJXV}>SDko cm6tCW^k1;DtVr9~05pQZ)78&qol`;+03$3ZtpET3 literal 0 HcmV?d00001 diff --git a/resource/images/darkstyle/up-arrow.png b/resource/images/darkstyle/up-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..3831252d0074faad7696eb13472c704389e46717 GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWND7f0w z#WAE}&f5u&Tug>MuH3H{uou2Rro6jY-J)Xdx~cQ$J@8J5;c$IpA}RPuAt2*rb*`7A z0E;8L3j5snliL~AS?!98vSZlM!BNU^r|8^n)p$F{p7DUI(4Bvs_rd`ta+23P1ekUC-SkGwpNZcc8NwJYD@<);T3K0RWRGUAF)L literal 0 HcmV?d00001 diff --git a/resource/images/icon_close.png b/resource/images/icon_close.png index d27a7ae2d2cd8d2aaca54fed269b01130193c1a0..9d842f49a670504094633ee6b6918c8a8b351083 100644 GIT binary patch delta 276 zcmV+v0qg#v0>lE4Ie+#^L_t(|ob8oO4uU`oh4lvhtQGbC=TPIuEf|$>0Qw#$7}I1- zhz|1u(P%=Gu4w1uJ(zYf8RIX5n2(qKz3kku3L$zy7_^hbwdIjK`ye2esdFflJ1qq8U2e6M`d}I7v aJOF|{Y9g;!Y7K$_00006Dx9XahUCh0QL zWyhv$@;slFbXOO{BppPM$71}LUQ)asNw*O!MC#VsrJj(I*#4i8ZZP29dq0u{>VyGb wlIBh7gbf1hCP#vivmk delta 287 zcmV+)0pR|Q1J44GIe!63L_t(|obA-lDh5#)2jGX5DE|sqVxicOjb!BlT!33pcCt~} zv17+Y*jQOgij-1{tYyLX(bTBvbf&%;=aj|wt9LW!o%76@W?uUFC)vOOrg9>4_`)|{ zv6=%J#$Ad0)&~YtL;C?z)LCj|9-RPr!%RwK1P_tZtV^7u2!C>#8d*j+K%Oy~5*fo& z(KxJ002ovPDHLkV1gashr0j( diff --git a/resource/images/icon_ellipsis.png b/resource/images/icon_ellipsis.png index 118d06cb17cda5c2bd9a232434ec21f80fdb77a2..61f85212c2e6452e764a4432a4932117c6325ebf 100644 GIT binary patch delta 168 zcmV;Z09XH|0@(qOIe&{uL_t(|ob8f93WPum1bxVQ_U($`$0nxZ2b3^-7{bni5cjZj zL7%2*LMFpN2qAlFaE9#u7K_qc)QQecmbNU_MO{Hp zuuzug;=6zwW%pbFTTf8cIh5tOW;XeUe|RjVlvi7p?n*uT#UXd^@rhzld#z8nKjQ*a Wo{jr;uZ|J`0000->E!`*18);JE=l0@agaoUXFt3y>#*yLk)w<1Nro u9Cw3L5Gr}A*+mNgQTp#BE zhUg;a+?HfJcbTt5s=5QvFM0K9k@x<<5lbcl&;YniNur6Cgf$cqe_1-@Y6cl+XrH{j qvkq+574#z3QtblKDakic_&@GWD$S`PjRji(0000hPw#5k(O@b6b5T6_pr6lh+rW> zLySp4%!6ND;3aT(fk?!F9+0O9&Dk6nfEo+rMN|@?0+ypb`w*o-YjBxYq6`=fUu`Wa zf$661Ow<6YM&e9llE*}m{A4ri6d~F>=)eYDK~9&dP$ZqNZx|x-Gd7Kkv1f$%L!JNt N002ovPDHLkV1lq)L_`1p diff --git a/resource/images/icon_last.png b/resource/images/icon_last.png index 85aff0a784422d0acc5fffb993c444ebd7488898..69c927b5b34af264a6ea960f94de0805120e2c03 100644 GIT binary patch delta 185 zcmV;q07n1T0qOyeIe(l(lMnp|Fi};NU}F~#o&REYrh$|Nm`oOWZ*EC zdo(By0CvFC9i%7h6l0vZgI+!ZiyEN5vOBPG2Yqt`g`c=ODl#>Le|uBo!2(;C5d>Un n4b@fYn~>CHp#5l2)BouKoO8|LUFq7t00000NkvXXu0mjf;D%KC delta 165 zcmV;W09ya*0oDPKIe&;rL_t(|obA;y3c^4TM&ZvJl8%5?D{U)alp3^X z0H2bo#vAO};vs|`Ne6wbEX(~qrBt5h0~ zM+ImAO?|oiGo4i8j1LuTi z=PZ%|_2fCdQ$70>QkcC&!FIDK*pcC3GcnR0_4(*%9 zRRxU{D-@wg=#RL_gIPV8FNDcNsX(9(5!s2zCCjpT6YmXh7ZC$IL}YD@8Cd-0+j~O zelg1SbZR% aT)Y7KCP&2i>%z1E0000wZulMAWfZ0PML*yNWfUcu-Q4ms)XFG|$y6e@*OwI~SiM!z63tgX zhB@k?5`pJC4ERw@fyfV8@Q&Kc&kvlO(zUcvunO#f^j%LV5GrZ$iJ~M%qR*(h_0^H=q&4Jr)=T20i>HZzt7COX^$)e9YE<3+)sgIsmYoRu Z!3$}7BEzFbb!-3t002ovPDHLkV1gf)IBNg^ delta 106 zcmV-w0G0o#0h|GlIb%*qL_t(|ob8i43IHGsLv#O&S-n(UoCLA-BMy0x`9Vkk@`wRI zSEN#;Tgsrw4XZQ#BpNwu@+5lu*)vg3lr#k3yxp+6|Eud+KOwL(0Vi*bz4$T0F#rGn M07*qoM6N<$f>6UO`2YX_ diff --git a/resource/images/icon_previous.png b/resource/images/icon_previous.png index 7a982c1285c6a4d2b31e93baae1297129dd72dba..da5d3eb6a9d8d660c3bed4b91eb8aa5dccd42cd6 100644 GIT binary patch delta 218 zcmV<0044wJ0gD2VIe)!LL_t(|ob8n{3PLduM5DD9{}6f?(Hp6q$FUdj5H@;GK10ystVc}h1CLKu=< z-wa;M8FdpPG6rybH+dR~$cW@2rCUR0yrZ!akts=}^wt1X?Nb9-0l1`09(~B_*$|Qq zfKAT8S}q5G?KeVbIMJ?DP*ddUiVZ_#yz#T~F8*MxE5>_2_;>{sU8+UDiOPR)1-*Gk UU(l@geETl_lWlbB-P1iV+OPhyU1OGs$^ z43~&cVujn6kbouXi0@>K9iEYpkl>?KICKQ0R+QsFO+vg4r!`!Ss$5T(Z5TesyZ+^P qXJ6RV6Ehj&1Z6#{S-*+GAMgTTF2y?=#xu460000p_s>MYY{y=RJAH$**wSA3h3oW>G z>)NJWbe+~vVhTkNe1Hb6K7!IkcO{E(Cv(o{U1=d#rkM+$@!s4-BYI$9m^m}&`y0Lq zg8PI3peAdp7<9MJa0g^8O906#OjDI_feGz%(&ulurwRSC6 z0Kg-Xdl{ETBqd{ShvZ*B|C#5-Qvkn{!vM}m7D+DF>-C2TuU4xKx;2s|&uJH}cJxGx zIC5GJ+F`Ao1@Nb9AssFN-{LrakS79QBO{E}%*1O_HzE!IzNZNR*bdU*s!Qc0H(Uuw zj*@&wa$Sx0Zht*Udnc-di@|MyG}QihOaEZ!L7jm|>Ok4_fF=KZ`*`UaI%BqAi$E<^AQRLL|4mNHYw> zu}hl(4*ll2h)iEsL_}r){PRX1Tp<9MSK&M8xp@VxhJTkB?2Ue&N+h|fNabF{;+9B7 z_ohs;wRQx+Nn7Wf?lN45%E)6^c^wY{n9^b{XC%Lh$Z{BlLkZ6qGwiFYq;m3K1i+K7 z!r(m9VN7Y|QC2I@^(4c)Ig-CReNNEYbDZ?V_X1Z`gn9^-;=63_%PV;$;1P#w59|(!lMTmGsiG%zLJ4|*iuB2!m%N* zh}z;LI#xvOO@Fd^0(=6KafWVC+1u8FRV9$J5*0aRZ&3@ZtYkdOIpB>|WdUI=-%zX{^hX)jJ(^PEcojSLBegida`v|G}I g?3&QY6Vp2Q0cGj3R~a2X1poj507*qoM6N<$f)xwR#{d8T diff --git a/resource/images/icon_refresh3_disable.png b/resource/images/icon_refresh3_disable.png index ab91e7e7ca1393138345cc605f66476ccd4ce458..fb9f0ef11fca9a61b40941ad92ea26e0cc52da54 100644 GIT binary patch delta 547 zcmV+;0^I$^1kePKIDY~HNkl?N$KJfK7j0y%^ zW}CH+F5C_H!XBs2Idn6_`~ZVde?r8CyKIAyWR(Oaa>?!CW~RHRM?2_&3q$wm`ubMY z?V2e1pJZm2Bs~Q1l4J`&o8&8!i)J=A?3Xk(5dgqVlHUOINq-)ctk06}`)8gxzoe&Q z0i90g49Q+zPyjn5w+es>fDQlqQz;}#l34&hg21}~UIVx-=~U+H^?E1WH309OCkMJ( zx|0y%%y~5!mZYmBe^v&C=>qVf*=(K|2O+sqkjB-r!VgSUAWkH$pq3w_Jh|@5YEmU# znIxSh`Gn+hwtplox$9BhImues6+SvHk$jwOS<;<4VoJJ2vXQ3gxe(L{K!XTCu8_kuIEIJl9f z>BXSE-_!tl=VSHT?e_U2H%Wf=Z?Kmn$^4%}BrO2g_kXe0Mhs?lBiQcR#KS8(9C*PC zADG#-TqDU&0BcPGlQiWg?_f5SnP*6T4<~1pG)h_scLHGDb>6s#t_;EUNWL|*yWMX0 zbmoiWc-nQBAAI{E#LO;NO~cGk8jpiMfWGq-7JfqD1$XfL l7o_D^102AEk#q8|^&95$qF(ovP_6&~002ovPDHLkV1o0U2*>~c delta 537 zcmV+!0_OeD1jYoAIDY~7Nklx&4Le_8K%1Xb-k*ot|a-N zU}oneJpk~Gqhwf#*&jxR#c_!wEkv1jf7jrp zK2L7|ug4_nshg_+GYB{8$P$eZ=D34gcZqS&Ma>2Fovj^cf{bRx-K zM7EKp>8YAUbr5-DqfWFHP5vtBdPTXu#YMT>?Vdhxkq56p=Hrd`3}$xOe`vq_LI{^g zE&+I3sBPPo`-rR(_v>EeB-JFgd4dc^G$+ICI-jpiP=rg7wOcFRZg~?z^0`arSIpQ1 bhl$_2$P%+=0mSuA00000NkvXXu0mjf&m#lh diff --git a/resource/images/icon_subtract.png b/resource/images/icon_subtract.png index 30eb021943ab12d62317b1b66aed206d0880c1c0..b141d0358ace1afa87d0659e325cac6682e620fb 100644 GIT binary patch delta 90 zcmV-g0Hyzc0gM5VIa5AKL_t(|obA!O2>>w=1JUijF@KsFbzmn>9i8AD=z-#a-KvO) wHvm)8at!F#kSn6I|3knqp00iVWkf_-Y&Enm+8|3nXaE2J07*qoM6N<$g4aGJ^8f$< delta 78 zcmeBSY+#&V>2Bod;uumf=k3{@ybKBgM;yN2m+%jEXBS`Fa6sA8%;S=|S-`?H^Hl}! i-L)+w?|Mwy@tlG4ncwxWExUI!0D-5gpUXO@geCx?#U5+` diff --git a/source/attributeSelector.cpp b/source/attributeSelector.cpp index 994648a..fb4762a 100644 --- a/source/attributeSelector.cpp +++ b/source/attributeSelector.cpp @@ -15,7 +15,7 @@ AttributeSelector::AttributeSelector(const QString& connection, QWidget *parent) { //Linux下默认的Qt::Dialog即使有父窗口也无法按照子窗口的行为进行展示,并且最大、最小按钮不好关闭,因此需要去掉Dialog属性,随之而来的问题是,模态无法起作用 setWindowFlags(windowFlags() & ~Qt::Dialog); - setStyleSheet("QDialog{border: 1px solid rgb(205,205,205);border-radius:5px;background-color:rgb(245,245,245);}"); + setStyleSheet("QDialog{border: 1px solid rgb(110,110,110);border-radius:5px;background-color:rgb(30,30,30);}"); m_customBorderContainer = new CustomBorderContainer(this); m_customBorderContainer->setOperationOptions(CustomBorderContainer::Movable | CustomBorderContainer::Resizable); diff --git a/source/attributeTableDelegate.cpp b/source/attributeTableDelegate.cpp index b4a898b..37aa188 100644 --- a/source/attributeTableDelegate.cpp +++ b/source/attributeTableDelegate.cpp @@ -140,7 +140,7 @@ void AttributeTableDelegate::paint(QPainter* painter, const QStyleOptionViewItem if ((index.row() + 1) % 2 == 0) { //opt.backgroundBrush = QBrush(QColor(243, 245, 249)); - painter->fillRect(opt.rect, QColor(240, 248, 255)); + painter->fillRect(opt.rect, QColor(49, 54, 63)); } //处理加粗字体逻辑 @@ -154,9 +154,9 @@ void AttributeTableDelegate::paint(QPainter* painter, const QStyleOptionViewItem if(option.state.testFlag(QStyle::State_Selected)) { if(index.column() == 0) - painter->fillRect(opt.rect, QColor(70, 130, 180)); + painter->fillRect(opt.rect, QColor(49, 91, 125)); else - painter->fillRect(opt.rect, QColor(211, 241, 250)); + painter->fillRect(opt.rect, QColor(65, 122, 166)); } //如果行号列(第一列)被选中,做整行处理 @@ -165,7 +165,7 @@ void AttributeTableDelegate::paint(QPainter* painter, const QStyleOptionViewItem QModelIndex numberIndex = m_tableView->model()->index(index.row(), 0); QItemSelectionModel *selectionModel = m_tableView->selectionModel(); if(selectionModel->isSelected(numberIndex)) - painter->fillRect(opt.rect, QColor(211, 241, 250)); + painter->fillRect(opt.rect, QColor(65, 122, 166)); } //先执行默认绘制(包括背景、文本等基础元素) @@ -270,6 +270,7 @@ QWidget* AttributeTableDelegate::createEditor(QWidget *parent, const QStyleOptio else if(dataCol == 3) //数据长度 { QSpinBox* spinBox = new QSpinBox(parent); + //spinBox->setStyleSheet("border-radius: 0px;"); spinBox->setRange(-1, 999); spinBox->setValue(0); return spinBox; @@ -277,6 +278,7 @@ QWidget* AttributeTableDelegate::createEditor(QWidget *parent, const QStyleOptio else if(dataCol == 5) //可见性 { QComboBox* comboBox = new QComboBox(parent); + //comboBox->setStyleSheet("QComboBox{border-radius: 0px;background-color:rgb(67, 73, 87);}"); comboBox->addItem("1"); comboBox->addItem("0"); comboBox->addItem("2"); @@ -384,8 +386,22 @@ void AttributeTableDelegate::updateEditorGeometry(QWidget *editor, const QStyleO nY = 0; textEditor->setGeometry(nX, nY, editorSize.width(), editorSize.height()); } + // else if(QComboBox* comboBox = qobject_cast(editor)) + // { + // comboBox->setGeometry(option.rect); + // comboBox->setStyleSheet("border-radius: 0px;background-color:rgb(58, 63, 75);"); + // } + else if(QSpinBox* spinBox = qobject_cast(editor)) + { + spinBox->setGeometry(option.rect.adjusted(-3,-3,3,3)); + spinBox->setStyleSheet("background-color:rgb(58, 63, 75);"); //QSpinBox不能设置和border相关的项,否则up button无法点击,暂时不知道原因 + } else + { editor->setGeometry(option.rect); + editor->setStyleSheet("border-radius: 0px;background-color:rgb(58, 63, 75);"); + } + } bool AttributeTableDelegate::isEnumType(const QModelIndex& index) const diff --git a/source/attributeView.cpp b/source/attributeView.cpp index 00e2970..20df92a 100644 --- a/source/attributeView.cpp +++ b/source/attributeView.cpp @@ -31,8 +31,8 @@ AttributeView::AttributeView(const ModelAttributeGroup& modelAttributeGroup, QWi //自定义表头 m_multiLinHeader = new MultiLineHeaderView(Qt::Horizontal, this); - QColor bg(246, 246, 246); - QColor border(228, 228, 228); + QColor bg(40, 40, 40); + QColor border(30, 30, 30); m_multiLinHeader->setBackgroundColor(bg); m_multiLinHeader->setBorderColor(border); //主标题加粗展示 diff --git a/source/connectionDialog.cpp b/source/connectionDialog.cpp index c9fd000..c52c03a 100644 --- a/source/connectionDialog.cpp +++ b/source/connectionDialog.cpp @@ -19,7 +19,7 @@ ConnectionDialog::ConnectionDialog(QWidget *parent) { //Linux下默认的Qt::Dialog即使有父窗口也无法按照子窗口的行为进行展示,并且最大、最小按钮不好关闭,因此需要去掉Dialog属性,随之而来的问题是,模态无法起作用 setWindowFlags(windowFlags() & ~Qt::Dialog); - setStyleSheet("QDialog{border: 1px solid rgb(205,205,205);border-radius:5px;background-color:rgb(245,245,245);}"); + setStyleSheet("QDialog{border: 1px solid rgb(110,110,110);border-radius:5px;background-color:rgb(30,30,30);}"); m_customBorderContainer = new CustomBorderContainer(this); m_customBorderContainer->setOperationOptions(CustomBorderContainer::Movable | CustomBorderContainer::Resizable); diff --git a/source/groupSelectionDialog.cpp b/source/groupSelectionDialog.cpp index 30acca1..f777e9a 100644 --- a/source/groupSelectionDialog.cpp +++ b/source/groupSelectionDialog.cpp @@ -21,7 +21,7 @@ GroupSelectionDialog::GroupSelectionDialog(QWidget *parent) { //Linux下默认的Qt::Dialog即使有父窗口也无法按照子窗口的行为进行展示,并且最大、最小按钮不好关闭,因此需要去掉Dialog属性,随之而来的问题是,模态无法起作用 setWindowFlags(windowFlags() & ~Qt::Dialog); - setStyleSheet("QDialog{border: 1px solid rgb(205,205,205);border-radius:5px;background-color:rgb(250,250,250);}"); + setStyleSheet("QDialog{border: 1px solid rgb(110,110,110);border-radius:5px;background-color:rgb(30,30,30);}"); m_customBorderContainer = new CustomBorderContainer(this); m_customBorderContainer->setOperationOptions(CustomBorderContainer::Movable | CustomBorderContainer::Resizable); diff --git a/source/main.cpp b/source/main.cpp index 7e01720..96c734c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -2,11 +2,13 @@ #include "logger.h" #include +#include int main(int argc, char *argv[]) { qputenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "0"); // Wayland 下启用装饰 QApplication a(argc, argv); + //a.setStyle(QStyleFactory::create("Fusion")); LOG_INFO("Application", "------------------------------------------------Application start------------------------------------------------"); MainWindow w; diff --git a/source/maskLayer.cpp b/source/maskLayer.cpp index 99beba0..964c39e 100644 --- a/source/maskLayer.cpp +++ b/source/maskLayer.cpp @@ -8,7 +8,7 @@ MaskLayer::MaskLayer(QWidget *parent) setObjectName("maskLayer"); setFocusPolicy(Qt::NoFocus); setAttribute(Qt::WA_TranslucentBackground); // 启用透明背景 - setStyleSheet("background:rgba(112,128,144,180);"); + setStyleSheet("background:rgba(40, 74, 102, 150);"); hide(); } diff --git a/source/messageBox.cpp b/source/messageBox.cpp index b172b0f..e6cbbd7 100644 --- a/source/messageBox.cpp +++ b/source/messageBox.cpp @@ -13,7 +13,7 @@ MessageBox::MessageBox(QWidget *parent) { //Linux下默认的Qt::Dialog即使有父窗口也无法按照子窗口的行为进行展示,并且最大、最小按钮不好关闭,因此需要去掉Dialog属性,随之而来的问题是,模态无法起作用 setWindowFlags(windowFlags() & ~Qt::Dialog); - setStyleSheet("QDialog{border: 1px solid rgb(205,205,205);border-radius:5px;background-color:rgb(245,245,245);background-color:rgb(245,245,245);}"); + setStyleSheet("QDialog{border: 1px solid rgb(110,110,110);border-radius:5px;background-color:rgb(30,30,30);}"); } else { diff --git a/source/messageDialog.cpp b/source/messageDialog.cpp index f4a4091..dde6d90 100644 --- a/source/messageDialog.cpp +++ b/source/messageDialog.cpp @@ -13,7 +13,7 @@ MessageDialog::MessageDialog(QWidget *parent) { //Linux下默认的Qt::Dialog即使有父窗口也无法按照子窗口的行为进行展示,并且最大、最小按钮不好关闭,因此需要去掉Dialog属性,随之而来的问题是,模态无法起作用 setWindowFlags(windowFlags() & ~Qt::Dialog); - setStyleSheet("QDialog{border: 1px solid rgb(205,205,205);border-radius:5px;background-color:rgb(245,245,245);background-color:rgb(245,245,245);}"); + setStyleSheet("QDialog{border: 1px solid rgb(110,110,110);border-radius:5px;background-color:rgb(30,30,30);}"); } else { diff --git a/source/modelInfoEditDialog.cpp b/source/modelInfoEditDialog.cpp index c9b191f..83fe8bf 100644 --- a/source/modelInfoEditDialog.cpp +++ b/source/modelInfoEditDialog.cpp @@ -26,7 +26,7 @@ ModelInfoEditDialog::ModelInfoEditDialog(QWidget *parent) { //Linux下默认的Qt::Dialog即使有父窗口也无法按照子窗口的行为进行展示,并且最大、最小按钮不好关闭,因此需要去掉Dialog属性,随之而来的问题是,模态无法起作用 setWindowFlags(windowFlags() & ~Qt::Dialog); - setStyleSheet("QDialog{border: 1px solid rgb(205,205,205);border-radius:5px;background-color:rgb(250,250,250);}"); + setStyleSheet("QDialog{border: 1px solid rgb(110,110,110);border-radius:5px;}"); m_customBorderContainer = new CustomBorderContainer(this); m_customBorderContainer->setOperationOptions(CustomBorderContainer::Movable | CustomBorderContainer::Resizable); @@ -88,6 +88,7 @@ void ModelInfoEditDialog::showEvent(QShowEvent* e) item->setFlags(item->flags() & ~Qt::ItemIsEditable); item->setData(Qt::UserRole + itemRole_groupID, group.id); item->setData(Qt::UserRole + itemRole_isPublic, group.isPublic); + item->setForeground(QBrush(QColor(240,240,240))); ui->selectedList->addItem(item); } @@ -159,12 +160,13 @@ void ModelInfoEditDialog::refreshGroupList() sourceItem->setFlags(sourceItem->flags() & ~Qt::ItemIsEditable); sourceItem->setData(Qt::UserRole + itemRole_groupID, group.id); sourceItem->setData(Qt::UserRole + itemRole_isPublic, group.isPublic); + sourceItem->setForeground(QBrush(QColor(240,240,240))); ui->sourceList->addItem(sourceItem); if(group.isPublic) { QListWidgetItem* selectedItem = new QListWidgetItem(*sourceItem); //selectedItem->setIcon(QIcon(":/img/images/icon_no.png")); - selectedItem->setForeground(QBrush(QColor(128,128,128))); + selectedItem->setForeground(QBrush(QColor(140,140,140))); ui->selectedList->addItem(selectedItem); } } diff --git a/source/multiLineHeaderView.cpp b/source/multiLineHeaderView.cpp index d7c7286..864a235 100644 --- a/source/multiLineHeaderView.cpp +++ b/source/multiLineHeaderView.cpp @@ -73,7 +73,8 @@ void MultiLineHeaderView::paintSection(QPainter* painter, const QRect& rect, int QPen pen(m_borderColor, 1); painter->setPen(pen); QRect adjustRect = rect.adjusted(0, 0, 1, 0); - painter->drawLine(adjustRect.topLeft(), adjustRect.bottomLeft()); + //painter->drawLine(adjustRect.topLeft(), adjustRect.topRight()); + painter->drawLine(adjustRect.bottomLeft(), adjustRect.bottomRight()); painter->drawLine(adjustRect.topRight(), adjustRect.bottomRight()); } //自动调整行高 diff --git a/ui/attributeSelector.ui b/ui/attributeSelector.ui index 21ca380..a4619b8 100644 --- a/ui/attributeSelector.ui +++ b/ui/attributeSelector.ui @@ -7,7 +7,7 @@ 0 0 998 - 492 + 490 @@ -48,17 +48,7 @@ - QWidget #searchBar -{ -background-color: rgb(243, 243, 243); -} - -QLineEdit -{ -border:1px solid rgb(210,210,210); -border-radius:3px; -} - + @@ -220,7 +210,6 @@ border:0px; QWidget #toolBar { - background-color: rgb(243, 243, 243); } QPushButton @@ -230,11 +219,11 @@ QPushButton } QPushButton:hover { - background-color:rgba(70,130,180,35); + background-color:rgb(71, 77, 92); } QPushButton:pressed { - background-color:rgba(70,130,180,65); + background-color:rgb(67, 73, 87); } @@ -540,8 +529,7 @@ QPushButton:pressed - border:0px; -background-color: rgb(255, 255, 255); + 1 diff --git a/ui/connectionDialog.ui b/ui/connectionDialog.ui index 24dc0af..10a87b2 100644 --- a/ui/connectionDialog.ui +++ b/ui/connectionDialog.ui @@ -64,8 +64,7 @@ QTableView::item:hover } QTableView::item:selected { - color:rgb(0,0,0); - background-color:rgb(211, 241, 250); + background-color: rgb(49, 91, 125); } @@ -483,15 +482,18 @@ QTableView::item:selected 0 - 26 + 21 16777215 - 26 + 21 + + + PostgreSQL diff --git a/ui/dbBrowser.ui b/ui/dbBrowser.ui index f7f58ad..446460d 100644 --- a/ui/dbBrowser.ui +++ b/ui/dbBrowser.ui @@ -45,15 +45,7 @@ QTabBar::close-button:hover { QTabBar::close-button:pressed { border-image: url(:/img/images/btn_close_pressed.png); } - -QHeaderView -{ -background-color: rgb(235, 235, 235); -} - -QHeaderView::section -{ -} + -1 @@ -89,11 +81,11 @@ QPushButton } QPushButton:hover { - background-color:rgba(70,130,180,35); + background-color:rgb(71, 77, 92); } QPushButton:pressed { - background-color:rgba(70,130,180,65); + background-color:rgb(67, 73, 87); } @@ -444,8 +436,7 @@ QPushButton:pressed - border:0px; -background-color: rgb(255, 255, 255); + 1 diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 24b8058..2f1b6ee 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -18,39 +18,144 @@ :/img/images/icon_database.png:/img/images/icon_database.png - QPushButton + QWidget { - border: 1px solid rgb(205,205,205); + color: rgb(240, 240, 240); + background-color: rgb(30, 30, 30); + background-clip: border; + outline:0; +} + +QMenuBar +{ + background-color: rgb(30, 30, 30); + color: rgb(240, 240, 240); + border-bottom: 1px solid rgb(50, 50, 50); +} + +QToolBar +{ + border: 1px solid transparent; + background:rgb(30, 30, 30); + font-weight: bold; +} +QToolBar::separator:horizontal +{ + background:transparent; +} + +QToolButton:hover, QToolButton::menu-button:hover +{ + border:0px; + background-color:rgb(71, 77, 92); +} +QToolButton:checked, QToolButton:pressed, + QToolButton::menu-button:pressed +{ + border:0px; + background-color:rgb(67, 73, 87); +} + +QLineEdit +{ + border: 0px; + border-radius: 5px; + background-color: rgb(45, 45, 45); +} + +QPlainTextEdit +{ + border: 0px; + border-radius: 5px; + background-color: rgb(45, 45, 45); +} + +QPushButton +{ + border: 1px solid rgb(110,110,110); border-radius:5px; } QPushButton:hover { - border-color: rgb(70,130,180); + border-color: rgb(65, 122, 166); } QPushButton:pressed { - background-color:rgba(70,130,180,50); + background-color:rgba(65, 122, 166,50); } QPushButton:disabled { - color:rgb(180,180,180); + color:rgb(110,110,110); } +QComboBox +{ + background-color: rgb(45, 45, 45); + border: 0px; + border-radius: 5px; +} +QComboBox::drop-down +{ +border:0px; +} +QComboBox::down-arrow +{ +margin-right:10px; +width:14px; +border-image: url(:/theme/images/darkstyle/down-arrow.png); +} QComboBox QAbstractItemView { -outline: 0px; /* 去除选中虚线框 */ +outline: 0px; /*去除选中虚线框 */ } QComboBox QAbstractItemView::item:hover { -color:rgb(0,0,0); -background-color: rgb(240, 248, 255); +background-color:rgba(49, 91, 125, 80); } QComboBox QAbstractItemView::item:selected { -color:rgb(0,0,0); -background-color: rgb(211, 241, 250); +background-color: rgb(49, 91, 125); } +/* QSpinBox +{ +background-color: rgb(45, 45, 45); +} +QSpinBox::up-button +{ +border:0px; +} +QSpinBox::up-button:hover +{ +background-color:rgb(71, 77, 92); +} +QSpinBox::up-button:pressed +{ +background-color:rgb(67, 73, 87); +} +QSpinBox::up-arrow +{ +width:14px; +border-image: url(:/theme/images/darkstyle/up-arrow.png); +} +QSpinBox::down-button +{ +border:0px; +} +QSpinBox::down-button:hover +{ +background-color:rgb(71, 77, 92); +} +QSpinBox::down-button:pressed +{ +background-color:rgb(67, 73, 87); +} +QSpinBox::down-arrow +{ +width:14px; +border-image: url(:/theme/images/darkstyle/down-arrow.png); +}*/ + QTabWidget { @@ -58,7 +163,7 @@ QTabWidget QTabWidget::pane { border:0px; - border-top: 1px solid rgb(225,225,225);; + border-top: 1px solid rgb(50,50,50);; border-radius: 2px; margin-top:-1px; } @@ -69,9 +174,10 @@ QTabWidget::tab-bar QTabBar::tab { height:26px; - border: 0px solid; + border: 0px; padding-left:10px; padding-right:10px; + border-bottom: 1px solid rgb(50,50,50); } QTabBar::tab:selected { @@ -81,7 +187,7 @@ QTabBar::tab:selected QHeaderView { - background-color: rgb(250, 250, 250); + background-color: rgb(30, 30, 30); } QHeaderView::section { @@ -90,6 +196,7 @@ QHeaderView::section QTableView { outline:0px; + background-color: rgb(45, 45, 45); } QTableView::item { @@ -100,10 +207,15 @@ QTableView::item:hover { background-color:transparent; } +QTableView::item:selected +{ + color: rgb(240, 240, 240); +} QTreeView { outline:0px; + background-color: rgb(45, 45, 45); } QTreeView::item { @@ -111,17 +223,27 @@ QTreeView::item } QTreeView::item:hover { - background-color: rgb(240, 248, 255); + background-color:rgba(49, 91, 125, 80); } QTreeView::item:selected { - color:rgb(0,0,0); - background-color:rgb(211, 241, 250); + background-color: rgb(49, 91, 125); +} +QTreeView::branch:has-children:!has-siblings:closed, +QTreeView::branch:closed:has-children:has-siblings +{ + image: url(:/theme/images/darkstyle/branch_closed.png); +} +QTreeView::branch:open:has-children:!has-siblings, +QTreeView::branch:open:has-children:has-siblings +{ + image: url(:/theme/images/darkstyle/branch_open.png); } QListView { outline:0px; +background-color: rgb(45, 45, 45); } QListView::item { @@ -132,11 +254,11 @@ padding-bottom:1px; } QListView::item:hover { -background-color: rgb(240, 248, 255); +background-color:rgba(49, 91, 125, 80); } QListView::item:selected { -background-color:rgb(211, 241, 250); +background-color: rgb(49, 91, 125); } @@ -163,6 +285,9 @@ background-color:rgb(211, 241, 250); Qt::Orientation::Horizontal + + + 0 diff --git a/ui/modelInfoEditDialog.ui b/ui/modelInfoEditDialog.ui index f59520c..0a08b6e 100644 --- a/ui/modelInfoEditDialog.ui +++ b/ui/modelInfoEditDialog.ui @@ -222,11 +222,11 @@ } QPushButton:hover { - background-color:rgba(70,130,180,35); + background-color:rgb(71, 77, 92); } QPushButton:pressed { - background-color:rgba(70,130,180,65); + background-color:rgb(67, 73, 87); } diff --git a/ui/textEditWidget.ui b/ui/textEditWidget.ui index fc2b9a8..44ffc9a 100644 --- a/ui/textEditWidget.ui +++ b/ui/textEditWidget.ui @@ -16,8 +16,6 @@ QWidget #TextEditWidget { -border: 1px solid rgb(205,205,205); -background-color:rgb(255,255,255); } @@ -41,8 +39,8 @@ background-color:rgb(255,255,255); QWidget #contentWidget { -border: 1px solid rgb(205,205,205); -background-color:rgb(255,255,255); +border: 1px solid rgb(67, 73, 87); +background-color: rgb(58, 63, 75); } @@ -50,13 +48,13 @@ background-color:rgb(255,255,255); 0 - 0 + 1 - 0 + 1 - 0 + 1 5 @@ -67,9 +65,8 @@ background-color:rgb(255,255,255); Qt::FocusPolicy::StrongFocus - background-color: transparent; -border:0px; -padding:2px; + border-radius: 0px; +background-color:transparent; @@ -90,8 +87,9 @@ padding:2px; QWidget #bottomWidget { - background-color: transparent; -} +background-color:transparent; +} + @@ -113,7 +111,8 @@ padding:2px; color: rgb(255, 0, 0); -font: 8pt "Microsoft YaHei UI"; +font: 8pt "Microsoft YaHei UI"; +background-color:transparent; 该类型已存在 @@ -145,17 +144,13 @@ font: 8pt "Microsoft YaHei UI"; QPushButton { - border: 1px solid rgb(205,205,205); - border-radius:5px; +color: rgb(240, 240, 240); +font: 10pt; +border-radius:5px; +background-color: transparent; } -QPushButton:hover -{ - border-color: rgb(70,130,180); -} -QPushButton:pressed -{ - background-color:rgba(70,130,180,50); -} + + 取消 @@ -179,20 +174,21 @@ QPushButton:pressed QPushButton { -color: rgb(250, 250, 250); +color: rgb(240, 240, 240); font: 10pt; border:0px; border-radius:5px; -background-color:rgb(67,160,249); +background-color: rgb(49, 91, 125); } QPushButton:hover { -background-color:rgb(55,131,204); +background-color: rgb(65, 122, 166); } QPushButton:pressed { -background-color:rgb(67,160,249); -} +background-color: rgb(49, 91, 125); +} + 确认