GUI: Add tray icons

This commit is contained in:
av-dx 2021-06-22 22:31:41 +05:30 committed by Eugene Sandulenko
parent 5552454bce
commit ae6835b2f9
9 changed files with 145 additions and 3 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

View File

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 120 120"
version="1.1"
id="svg10"
sodipodi:docname="button_load.svg"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs14" />
<sodipodi:namedview
id="namedview12"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="6.0583333"
inkscape:cx="59.917469"
inkscape:cy="59.339752"
inkscape:window-width="1920"
inkscape:window-height="1024"
inkscape:window-x="1920"
inkscape:window-y="28"
inkscape:window-maximized="1"
inkscape:current-layer="svg10" />
<path
d="M73.265 13.79L30.958 56.096l-11.74-11.74 42.308-42.31z"
id="path2" />
<path
d="M51.943 19.938h19.055v60.21H51.943z"
id="path4" />
<path
d="M61.454 2l42.326 42.29-11.724 11.74-42.33-42.307zM10 99.575h103v17H10z"
id="path6" />
<path
d="M6.5 68.576h17v48h-17zm92 0h17v48h-17z"
id="path8" />
<path
style="fill:#e6e6e6;stroke-width:0.165062"
d="M 51.994498,57.48329 V 34.911559 L 41.47112,45.433974 30.947742,55.956388 25.185179,50.192062 19.422617,44.427734 40.454086,23.291818 61.485557,2.1559044 82.57219,23.237244 103.65882,44.318585 97.881775,50.095631 92.104731,55.872677 81.540673,45.309587 70.976616,34.746497 v 22.654262 22.654262 h -9.491059 -9.491059 z"
id="path90" />
<path
style="fill:#e6e6e6;stroke-width:0.165062"
d="M 6.6024759,92.599725 V 68.66575 H 15.020633 23.43879 V 84.181568 99.697387 H 60.990371 98.541953 V 84.181568 68.66575 h 8.418157 8.41816 V 92.599725 116.5337 H 60.990371 6.6024759 Z"
id="path129" />
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 120 120"
version="1.1"
id="svg4"
sodipodi:docname="button_options.svg"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="4.2838886"
inkscape:cx="73.99819"
inkscape:cy="33.497603"
inkscape:window-width="1920"
inkscape:window-height="1024"
inkscape:window-x="1920"
inkscape:window-y="28"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M114.25 70.73c2.21 0 4.27-1.792 4.572-3.984 0 0 .422-3.08.422-6.745s-.422-6.74-.422-6.74c-.304-2.19-2.36-3.98-4.572-3.98h-11.433c-2.214 0-4.512-1.41-5.106-3.134s-1.41-7.255.16-8.82l8.08-8.08c1.566-1.565 1.688-4.236.27-5.937l-9.51-9.51c-1.7-1.42-4.37-1.3-5.94.267l-8.08 8.08c-1.56 1.568-4.17 2.198-5.79 1.404s-6.162-4.143-6.162-6.356V5.75c0-2.213-1.793-4.27-3.984-4.572 0 0-3.08-.424-6.746-.424s-6.744.424-6.744.424c-2.197.3-3.99 2.36-3.99 4.572v11.433c0 2.213-1.41 4.51-3.137 5.106s-7.255 1.41-8.82-.16l-8.08-8.08C27.67 12.49 25 12.37 23.3 13.78l-9.51 9.51c-1.416 1.7-1.296 4.37.27 5.94l8.08 8.08c1.565 1.566 2.197 4.173 1.4 5.793s-4.14 6.165-6.353 6.165H5.75c-2.21 0-4.27 1.792-4.57 3.984 0 0-.424 3.08-.424 6.744s.424 6.743.424 6.743c.3 2.195 2.36 3.99 4.572 3.99h11.44c2.215 0 4.51 1.41 5.107 3.134.592 1.725 1.41 7.254-.155 8.818l-8.08 8.08C12.5 92.33 12.38 95 13.798 96.7l9.507 9.51c1.7 1.42 4.37 1.3 5.935-.27l8.08-8.08c1.565-1.56 4.172-2.19 5.793-1.4s6.16 4.146 6.16 6.358v11.433c0 2.21 1.795 4.27 3.99 4.57 0 0 3.08.428 6.744.428s6.745-.423 6.745-.423c2.194-.3 3.986-2.36 3.986-4.57v-11.43c0-2.214 1.41-4.513 3.136-5.107 1.726-.592 7.256-1.41 8.82.154l8.08 8.08c1.565 1.566 4.236 1.69 5.938.27l9.507-9.505c1.42-1.7 1.3-4.37-.27-5.937l-8.08-8.08c-1.565-1.567-2.197-4.175-1.4-5.796.793-1.62 4.142-6.162 6.354-6.162h11.44zM60 81.688c-11.977 0-21.686-9.707-21.686-21.687 0-11.97 9.71-21.68 21.686-21.68S81.687 48.03 81.687 60 71.977 81.687 60 81.687z"
fill="#010101"
id="path2" />
<path
style="fill:#e6e6e6;stroke-width:0.165062"
d="m 56.616231,119.07618 c -4.114371,-0.35864 -4.825396,-0.58312 -6.005926,-1.89615 -1.239109,-1.37819 -1.256797,-1.49929 -1.256797,-8.60419 v -6.24844 l -0.416252,-0.82143 c -0.546558,-1.07858 -2.496401,-2.992771 -4.247995,-4.170319 -1.756287,-1.180702 -2.192349,-1.331531 -3.561938,-1.232022 -2.147449,0.156025 -2.415962,0.349826 -7.619758,5.499621 -2.955438,2.92477 -4.980394,4.79934 -5.447042,5.04252 -1.026613,0.53498 -2.744298,0.54837 -3.797891,0.0296 -0.51416,-0.25316 -2.308406,-1.937 -5.80374,-5.44664 -4.937379,-4.957578 -5.066303,-5.103767 -5.341507,-6.056867 -0.337702,-1.16955 -0.250774,-2.242587 0.264288,-3.262383 0.225503,-0.446482 2.041678,-2.408751 4.860981,-5.252003 l 4.500969,-4.539203 0.20387,-0.990371 c 0.404035,-1.962743 -0.0581,-6.328962 -0.830031,-7.842069 -0.469927,-0.921138 -1.785486,-1.905798 -3.080756,-2.305866 -1.004585,-0.310285 -1.52451,-0.333496 -7.470356,-0.333496 -7.2630425,0 -7.3647781,-0.01462 -8.7463797,-1.256797 -1.0822379,-0.973025 -1.4469749,-1.787121 -1.6924625,-3.77759 -0.26264299,-2.12957 -0.26180781,-9.280904 0.00132,-11.284343 0.252498,-1.922521 0.4674943,-2.443015 1.4374342,-3.479961 1.3747769,-1.469747 1.519903,-1.494293 8.83469,-1.494293 H 17.6726 l 0.795967,-0.403347 c 1.406335,-0.712645 3.947146,-3.539124 5.038266,-5.604732 0.730412,-1.382746 0.519571,-3.430511 -0.528562,-5.1336 -0.223486,-0.363136 -2.418413,-2.6823 -4.877614,-5.153699 -2.459202,-2.471398 -4.610183,-4.764208 -4.779957,-5.095132 -0.463407,-0.903272 -0.541063,-2.168495 -0.197782,-3.222407 0.267045,-0.819859 0.68963,-1.29128 5.422817,-6.049518 4.622832,-4.647301 5.223834,-5.1946 6.044766,-5.504647 1.119445,-0.422787 2.409737,-0.354635 3.481973,0.183915 0.47327,0.237708 2.330538,1.955536 5.270031,4.874365 5.183792,5.147351 4.585504,4.786968 7.922972,4.772459 2.321339,-0.01009 4.489096,-0.38383 5.522939,-0.952196 0.888732,-0.488588 1.842325,-1.792171 2.237693,-3.058973 0.302791,-0.970173 0.327401,-1.529371 0.327401,-7.439646 0,-7.2630425 0.01462,-7.3647781 1.256797,-8.7463797 C 51.012482,2.3726522 51.655578,1.8554152 52.039406,1.6705549 53.135546,1.1426295 55.489758,0.92094498 60,0.92094498 c 4.484357,0 6.864289,0.22163542 7.939454,0.73937632 0.835722,0.4024379 1.798683,1.343903 2.269291,2.2186333 0.342497,0.6366066 0.358171,0.8996121 0.437747,7.3452544 0.07978,6.461822 0.09449,6.707341 0.440668,7.353967 0.744936,1.391458 3.849164,4.105906 5.745082,5.023705 0.654836,0.316999 0.961396,0.361729 2.038042,0.297364 2.272902,-0.135881 2.596151,-0.366279 7.952274,-5.668023 2.587346,-2.561075 4.964237,-4.793448 5.281981,-4.960826 0.854681,-0.450222 2.663129,-0.423233 3.632829,0.05422 0.515043,0.25359 2.300361,1.930973 5.797112,5.446638 4.65527,4.680447 5.07566,5.150159 5.34254,5.969341 0.35541,1.090926 0.26322,2.315023 -0.25157,3.340135 -0.2325,0.462972 -1.98222,2.353393 -4.87016,5.261777 -5.157576,5.194094 -4.787922,4.573778 -4.770584,8.005503 0.01156,2.285998 0.349435,4.282884 0.91227,5.391512 0.373749,0.736178 1.445064,1.638934 2.548584,2.147592 0.80315,0.370206 0.96339,0.379684 7.83505,0.463431 6.90103,0.08411 7.02766,0.09167 7.78572,0.465099 0.88474,0.435832 2.03552,1.611045 2.37637,2.426819 0.41117,0.984068 0.63161,3.691547 0.63161,7.757541 0,4.074791 -0.22049,6.773596 -0.63431,7.764015 -0.40136,0.960596 -1.67406,2.173378 -2.67295,2.54711 -0.84291,0.315372 -1.26802,0.335367 -7.1301,0.335367 h -6.23375 l -0.82301,0.410121 c -1.50372,0.749337 -4.105425,3.663901 -5.059727,5.668177 -0.440669,0.925515 -0.487961,1.168877 -0.416982,2.145804 0.156194,2.149849 0.349033,2.417094 5.499769,7.621841 2.91424,2.944805 4.80062,4.982073 5.04359,5.447042 0.50454,0.965508 0.54946,2.911841 0.0876,3.796424 -0.41474,0.79436 -10.097919,10.501265 -10.916038,10.942775 -0.961482,0.51887 -2.855137,0.50324 -3.878955,-0.032 -0.464997,-0.24311 -2.440324,-2.07282 -5.28198,-4.89261 -3.958391,-3.92793 -4.623685,-4.521922 -5.19945,-4.64222 -1.150142,-0.240307 -4.676966,-0.142802 -6.189821,0.171129 -1.713964,0.355662 -2.640727,0.872763 -3.384557,1.888462 -1.138826,1.555059 -1.132285,1.505769 -1.230772,9.274259 -0.08592,6.77748 -0.100969,7.0375 -0.444152,7.67538 -0.471027,0.8755 -1.434228,1.81676 -2.269291,2.21757 -0.372201,0.17865 -1.308092,0.40659 -2.079757,0.50653 -1.435342,0.18589 -7.905981,0.34762 -9.243466,0.23103 z m 7.10984,-37.63717 c 8.481275,-1.453396 15.290753,-7.815283 17.418035,-16.273134 0.588642,-2.340379 0.732001,-6.262527 0.319152,-8.731555 C 80.389812,50.014653 76.522034,44.435511 70.847452,41.121379 69.25572,40.191757 67.135316,39.350161 65.079605,38.832102 63.439606,38.418806 63.04438,38.383935 60,38.383935 c -3.04438,0 -3.439606,0.03487 -5.079605,0.448167 -4.146505,1.044961 -7.356335,2.868198 -10.361487,5.885497 -2.783742,2.794995 -4.626833,6.035031 -5.641781,9.917889 -0.647252,2.476181 -0.818601,6.423224 -0.386946,8.913343 0.807564,4.658644 2.791312,8.4943 6.109,11.811988 3.275332,3.275331 7.08366,5.257297 11.729457,6.104358 1.680885,0.306474 5.495487,0.292906 7.357433,-0.02617 z"
id="path84" />
</svg>

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 970 B

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 104 120"
version="1.1"
id="svg6"
sodipodi:docname="button_play.svg"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs10" />
<sodipodi:namedview
id="namedview8"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="4.2838886"
inkscape:cx="63.260282"
inkscape:cy="47.270137"
inkscape:window-width="1920"
inkscape:window-height="1024"
inkscape:window-x="1920"
inkscape:window-y="28"
inkscape:window-maximized="1"
inkscape:current-layer="svg6" />
<title
id="title2">Shape</title>
<path
d="M.242-.01l103.52 59.768-103.52 59.77V-.012z"
fill-rule="evenodd"
id="path4"
style="fill:#e6e6e6" />
<path
style="fill:#e6e6e6;stroke-width:0.233433"
d="m 0.23343278,59.75879 c 0,-36.517548 0.083795,-59.53415594 0.21656821,-59.48645175 C 0.94155747,0.44894986 103.39881,59.651579 103.39845,59.75879 103.39808,59.866165 0.94006875,119.06929 0.45011084,119.24524 0.31719142,119.29297 0.23343278,96.298011 0.23343278,59.75879 Z"
id="path142" />
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -132,6 +132,9 @@
<bitmap filename = 'editbtn_small.bmp' scalable_file = 'editbtn.svg' width = '16' height = '16'/>
<bitmap filename = 'switchbtn_small.bmp' scalable_file = 'switchbtn.svg' width = '16' height = '16'/>
<bitmap filename = 'fastreplay_small.bmp' scalable_file = 'fastreplay.svg' width = '16' height = '16'/>
<bitmap filename = 'button_play.bmp' scalable_file = 'button_play.svg' width = '15' height = '15'/>
<bitmap filename = 'button_load.bmp' scalable_file = 'button_load.svg' width = '15' height = '15'/>
<bitmap filename = 'button_options.bmp' scalable_file = 'button_options.svg' width = '15' height = '15'/>
</bitmaps>
<fonts>

View File

@ -133,9 +133,13 @@ void GridItemWidget::handleMouseDown(int x, int y, int button, int clickCount) {
int buttonWidth = tray->getWidth() / 4;
int buttonHeight = tray->getHeight() / 2;
ButtonWidget *playButton = new ButtonWidget(tray, (buttonWidth / 4), buttonHeight / 2, buttonWidth, buttonHeight, U32String("Play"), U32String(), kStartCmd);
ButtonWidget *loadButton = new ButtonWidget(tray, buttonWidth + 2*(buttonWidth / 4), buttonHeight / 2, buttonWidth, buttonHeight, U32String("Saves"), U32String(), kLoadGameCmd);
ButtonWidget *editButton = new ButtonWidget(tray, 2*buttonWidth + 3*(buttonWidth / 4), buttonHeight / 2, buttonWidth, buttonHeight, U32String("Edit"), U32String(), kEditGameCmd);
PicButtonWidget *playButton = new PicButtonWidget(tray, (buttonWidth / 4), buttonHeight / 2, buttonWidth, buttonHeight, U32String("Play"), kStartCmd);
PicButtonWidget *loadButton = new PicButtonWidget(tray, buttonWidth + 2*(buttonWidth / 4), buttonHeight / 2, buttonWidth, buttonHeight, U32String("Saves"), kLoadGameCmd);
PicButtonWidget *editButton = new PicButtonWidget(tray, 2*buttonWidth + 3*(buttonWidth / 4), buttonHeight / 2, buttonWidth, buttonHeight, U32String("Edit"), kEditGameCmd);
playButton->setGfxFromTheme("button_play.bmp");
loadButton->setGfxFromTheme("button_load.bmp");
editButton->setGfxFromTheme("button_options.bmp");
// playButton->markAsDirty();
tray->runModal();
}