From 2bf31c52071be8c51da9dd2f0dac28a9abcb22eb Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 18 Apr 2008 13:04:37 +0000 Subject: [PATCH] Improve SALOME style: provide standard icons for the message box --- adm_local/unix/make_common_starter.am | 6 +++++- src/Style/Makefile.am | 7 +++++-- src/Style/Style.qrc | 8 ++++++++ src/Style/Style_Salome.cxx | 22 ++++++++++++++++++++++ src/Style/Style_Salome.h | 4 ++++ src/Style/images/critical.png | Bin 0 -> 2328 bytes src/Style/images/information.png | Bin 0 -> 2087 bytes src/Style/images/question.png | Bin 0 -> 2188 bytes src/Style/images/warning.png | Bin 0 -> 2198 bytes 9 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/Style/Style.qrc create mode 100644 src/Style/images/critical.png create mode 100644 src/Style/images/information.png create mode 100644 src/Style/images/question.png create mode 100644 src/Style/images/warning.png diff --git a/adm_local/unix/make_common_starter.am b/adm_local/unix/make_common_starter.am index c4cf97577..ecead78c2 100644 --- a/adm_local/unix/make_common_starter.am +++ b/adm_local/unix/make_common_starter.am @@ -39,7 +39,11 @@ docdir = $(datadir)/doc/@PACKAGE@ %.qm: resources/%.ts $(LRELEASE) $< -qm $@ -EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=resources/%.ts) +# resource files generation +qrc_%.cxx: %.qrc + $(QRCC) $< -o $@ -name $(*F) + +EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cpp=%.qrc) $(nodist_salomeres_DATA:%.qm=resources/%.ts) mostlyclean-local: rm -f @builddir@/*_moc.cxx diff --git a/src/Style/Makefile.am b/src/Style/Makefile.am index c56fdb1a2..518ff8d09 100644 --- a/src/Style/Makefile.am +++ b/src/Style/Makefile.am @@ -38,11 +38,14 @@ dist_libSalomeStyle_la_SOURCES= \ MOC_FILES= \ Style_Salome_moc.cxx -nodist_libSalomeStyle_la_SOURCES= $(MOC_FILES) + +QRC_FILES= \ + qrc_Style.cxx + +nodist_libSalomeStyle_la_SOURCES= $(MOC_FILES) $(QRC_FILES) libSalomeStyle_la_CPPFLAGS=$(QT_INCLUDES) \ -I$(srcdir)/../Qtx libSalomeStyle_la_LDFLAGS=$(QT_MT_LIBS) \ ../Qtx/libqtx.la - diff --git a/src/Style/Style.qrc b/src/Style/Style.qrc new file mode 100644 index 000000000..7c529c541 --- /dev/null +++ b/src/Style/Style.qrc @@ -0,0 +1,8 @@ + + + images/critical.png + images/information.png + images/question.png + images/warning.png + + diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index 58b302c2a..ceb378a71 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -163,6 +163,8 @@ static const char* const minimize_xpm[] = { Style_Salome::Style_Salome() : QWindowsStyle() { + Q_INIT_RESOURCE(Style); + myModel = new Style_Model(); myModel->setDefaults( qApp ); @@ -1844,6 +1846,26 @@ QPixmap Style_Salome::standardPixmap(StandardPixmap stPixmap, const QStyleOption } } +QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon, + const QStyleOption* opt, + const QWidget* widget ) const +{ + switch ( standardIcon ) + { + case SP_MessageBoxInformation: + return QPixmap( ":/images/information.png" ); + case SP_MessageBoxWarning: + return QPixmap( ":/images/warning.png" ); + case SP_MessageBoxCritical: + return QPixmap( ":/images/critical.png" ); + case SP_MessageBoxQuestion: + return QPixmap( ":/images/question.png" ); + default: + break; + } + return QWindowsStyle::standardIconImplementation( standardIcon, opt, widget ); +} + int Style_Salome::styleHint( StyleHint hint, const QStyleOption* opt, const QWidget* widget, QStyleHintReturn* returnData ) const { diff --git a/src/Style/Style_Salome.h b/src/Style/Style_Salome.h index 67e6472eb..edcfd1973 100644 --- a/src/Style/Style_Salome.h +++ b/src/Style/Style_Salome.h @@ -69,6 +69,10 @@ public: SubControl, const QWidget* = 0 ) const; virtual QRect subElementRect( SubElement, const QStyleOption*, const QWidget* = 0 ) const; +protected slots: + QIcon standardIconImplementation( StandardPixmap, const QStyleOption* = 0, + const QWidget* = 0 ) const; + private: void updatePaletteColors(); void updateAllWidgets( QApplication* ); diff --git a/src/Style/images/critical.png b/src/Style/images/critical.png new file mode 100644 index 0000000000000000000000000000000000000000..3cf8e5b53a44dce2bc77379b86efdca75b47f120 GIT binary patch literal 2328 zcmW+&dr%YC9zMI9WCP??gP5q`ss$+o2?Z>0N3sDCya)tpdDTjIg(y@}v|2BcjlmGb zVpJ}oWy*qu8JhwnzbsRtg3}03mzh{o{AOnKN_d{J#0V-{ZI} zKAP>k+!+AC-V(DZ$${9rU@{zM(c#0>4sa@rNh<=th5s%faG^%vxTNJtvwttft* zc=p|k?3koD01kTsKxhD%qa64WfCFLxUdaIns|H}%o--Len*m@}Y}q8;cIelv1&We% z<1hiTvIKI#!$sK9)2C095y{EPCD^EQ&nw)dX&9mN25Eo%hAq6cO|%VDMc+w7!&)QB6N%SR)<14x~3AKWX_LBa>g>F=< zqNtmY)e5;=I5EQ~^9a!O5|BM6yfL=)>@`D2udXv8?Yx?<6b?KZY!}+8x$X|og@yAp zE1@OGkPW{pIy_&Q>0}O&P*f8dR=-sFv!s9nF|o@WkiMH?IdHu}5pn#x4-hnFojFOH z(Jru43r-C}X|Z9Hl*xgoqB@e8T_x*xAtQY{F{5Q{$P$4ky zLz2B3rr1?gEUAwVFH%}nLOtl197Y9!@Z3p!ua^N4NUPQkQ8>Ct*BT|{+IHm02KZvm zR8vNgx}q0Kf3qSq2*5ge?Dd>v8r~NwMk0aJC!?(=ATrF>d&02pU|R0t(*afxbP^{W#ZC4j46fXqWIesM#z|0!v(}986 zFH=*)Umx6`BS(+9nD3hK+PY6GSR#=~P@K`0Gay=Dv6>Q&9ZE?_VGO1;30fuw(dZDd zFt8X2~-r0%vE;{OoWZ2 z!kgi{tdI8mo^y*keIPOMJq=%68XkGX&cEx{sfiuebO$9$Pr5-Z?^Vu2H#&^d*oL6fNm~ z{N2aGE8xjEy)ky;9xfsn# zPzQVTLfBp6Hq8`#P0^oqi?dC|GjJKKY?Pw@bqe-dWKYle z%gxA&C6kZ2mZiO2edqi&N4WPVV$ZG5m7(_&zTUvDVGjQEB@)jk3z+r!`T4@@Y704Q z2gX{G6GAK40{Katecc>2;YRORK26oMnoQnT;%E(u1akGv%nXZ56zF@f@(sKH%Zwj? zfd?$bHWt0uDu?FTuX((00`oYU4`tg|cvEi52mdf2_;jWY;dGs$y%PfzY*~D||M=;> z_jZx6%x#|a#1#oL(v_*Xxt`va1V1-rJS4gOyU5w#V_{hiTC9%7s!Z#vC#-#V+mgqY zn`Rz3-|93XmB%0(-*PTQsvKUu97X%*X?)t2&<=2e&7r3vQui~aIm#tR&8SkOLf>^cd1;tn+a?PXxrXNLk#C=<-N_WEFrg=ln|zX~HFSvylITzD zkSAw{Fs?5IuN|h#18%dG+}>ZB>e^ILoJWR3zT2OenB~qG!&+LZ=G+4f<@;s%o6#{| z6xPo+s>~5XtFD*+NH-oN+$4GOL$si`EVCt0meH=cvzYG~bwPGMMl@Sps>zp(5#|oe z4bIvt54;Z<9x!wV@L=IbdL9VwlzPEdN;`JM$&~erTCoFtWUEs{CvMwhv6-zFm!M|5 zL!k|*c#Y={j&c?6vCfsyI_n0=$)otv& S=W@pu1GYrPZ@Lm8Kl(rI8_ekd literal 0 HcmV?d00001 diff --git a/src/Style/images/information.png b/src/Style/images/information.png new file mode 100644 index 0000000000000000000000000000000000000000..3cd976403a5ff4ddf25581e098b7aa7dc448e8dd GIT binary patch literal 2087 zcmW+%dpOhkAOGxP8=ILn8F4m>)&*ZCx0KB-DYeG$lrD^A*2xpORdV?<&9z*Lh-$j( zlp49!31dPL(nWQurR0_rDt9~U_s9GFdOz>yc|XtV^}KIsoNb#lHS{$A0GgXUT)8Tw z|27;(VV06h7(A;7s}sw#;NW_z&#C_fcDx8wBh3cd%|3xF6C0ALXS zGfEW>0}urPFv0`Cp#T8g&|LqA?f_uVZ+2z-9DNfwuT(n8Sx6WJ22y!|#6pb$RgBQi z%*=FMB?t=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3Y|TsK=mt6rY|;rTGkma4*xQ@#}ujtcS8M53QsqlddiMv-B;E zp~U)(S>$&0sa9&2$56|{rY|obXESz-Qwfph?%C0n&yRctkOc7QuKHcKDYR7e)WK%A LZLYVSc}f2Pin4Ij literal 0 HcmV?d00001 diff --git a/src/Style/images/question.png b/src/Style/images/question.png new file mode 100644 index 0000000000000000000000000000000000000000..b42fc1c7f6718eb37e75b6aef5d8e7e49a5fec0b GIT binary patch literal 2188 zcmWlbdpOkV7RTS;jJYsB($(2OTzrd)F9GS zwvfwI4xO^2+MVhgA)_RANtc}xW;AqB*j>yZbEZGm`o7QmJZnAAde{4W)+*p{+hl5D zZ2|x=4diVMHYoDL$V7ur$;|v>5aWHkohblN7X2^?R8%qymqvTITe$#SDbAYx`P7ey z-Mrwf0AxAt=_(S$L0kEaae3NTO<;(n#KBRmG1Kx>?59!y_u{rQA$Y*2BBx4i0XrA zCnjnxfDw$rEuifp1J~z-;PUqN_VS#Z9Qf0xPXfvbKln_`aXX(?OrM-e;rE%Z$c!6b zMC`TC=25x(X($k;f!@EaWIVPGn1#6%$7!65)h|1jl%+ zCtEvd@0XOcQaO10&<*^Nc%1E3!h67o2V}&Y1YAdrf^WOIxs{umn!;XQUi&Cq#v6H9 zV-&lm#-~O&U40A=xOWw9U&4gzw{M6QXjin;EG+KQ%*^h9?w82SP^%awQJDfqH@A50 zw~xD^Ub82XV7)@?gMzc3f{4V##N|A8&kZCXQHNZDjj!bOftv`xEU;sW^EmZVU%Vp<#dbb;#C^fc`Ku-?l0!x%d}BBFf* zky3CetTFezIb-2Vv3{PQsf-3thtb#dKCGM06%`f3rBatTp%Cg~H(j~HZiu{f(%w6; z>dw9DW2%YPJXk!x0jN7+vAz|k-BHRQdrtSc%HAWYNci}iKa5g_N85UUMp0A*%QHNB zBixX95*Z2SmRK^G@bQ$gMxk|ofBzjSxll!ln31bG8#lr9hp%JuO(ExIbWdtv^}~0PJWT# zl}~2>1E;M?xwCU>x`qx%4)nlDQTmt+-5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=oF;@2?`Po`qJM`}q33@m#%OPPV4Y z(3d^em|gZgJgQLA*TAEWY<$o%k4D&tMyZ0;RTA0oCdcmbqfS_>OP%_aJh literal 0 HcmV?d00001 diff --git a/src/Style/images/warning.png b/src/Style/images/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..471ec5888e56d90e8a2c951d974761f539e11c19 GIT binary patch literal 2198 zcmWkwX;f2L625r}*?1vfB0JZdT^vkFsy-%n ze0+9Z2zZ#VV}FC)z~Z1ziyp>PDB+Uj#qaDCr|0G@MlF1+YH3j#fawWq(%x8JTK_|7 z*(y>%pCzKuKHnuuYGPpY4Z0cqt2m2y>_}I@YCIesbhmn?hjo1T%Erl^Z0ur02A}0YoG*FP-V-^#%R- za}&C!r5Ux-Xy((`tzA^dhfgW)UYQVNTU4RW_V#G2di_#k&D!NgvG@=v`hu}i8%WKfQuWyC_ z@1F?UJyulk4NIs&AwWNxyj!MF#Db?G7(^&7(&aT27suANGDbsDfr!RXDFo(2irj;| zoVjw5rq@)WRXRH)2M`Ff(9B|-TW~mZw=RTWal&2uQnhj+@beAFA`pe4}dT2(0-~=wyF|09GrOll1e`oX~x1{OBPf z+nh>!kp>uvx&P|)0Su=6T~p#VS+Am7Z00s%sx#&i$%Z*?cb8y((O0!ihTQ}?0Pp$f zCkkbyzF*eTJvjchx0MWw(_9F0+4)+4Ipc-%K3j6j8i#wTtn*><2?67Ftb1&B;KD4$ z9z{iubdISrt_a_>ConJyR(FLqLAbLey*3?p>vu_|(%MVkizq>!#%s~c)TeLUIGY?E z_691OC;hp662E$?Q3(|mYbHk;d4yaLZZhy%Eu5id;Rpn#YNQcWvT;y#bsGG(zDb#1 zvc_V6NEVmo66kK6G%4Yyq(p;C$Dq&2Vk%}_<&Jvnoe2)M)!aul-I`$21$i3G?&yO? z!;fuB!AC!v(l(;w!+kwH14;pT^S& zB`3qLYPmxKp@VXGsUkS);!1lh^3bES6y^vweE#fHknK8P!F7^NA_NvYBg-2zO-C?HANzBMsFhk#@C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