diff --git a/art/textures/button-panel-bg.9.png b/art/textures/button-panel-bg.9.png new file mode 100644 index 00000000..bda62545 Binary files /dev/null and b/art/textures/button-panel-bg.9.png differ diff --git a/assets/style/uiskin.atlas b/assets/style/uiskin.atlas index d11c933b..d2e919dd 100644 --- a/assets/style/uiskin.atlas +++ b/assets/style/uiskin.atlas @@ -97,7 +97,7 @@ alpha-bar-25px-shifted index: -1 border rotate: false - xy: 528, 509 + xy: 26, 105 size: 5, 5 split: 2, 2, 2, 2 pad: 1, 1, 1, 1 @@ -106,14 +106,14 @@ border index: -1 border-circle rotate: false - xy: 520, 724 + xy: 520, 702 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 border-circle-error rotate: false - xy: 520, 708 + xy: 520, 686 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -146,21 +146,21 @@ box index: -1 box-colapse-off rotate: false - xy: 536, 875 + xy: 26, 205 size: 11, 11 orig: 11, 11 offset: 0, 0 index: -1 box-colapse-on rotate: false - xy: 26, 205 + xy: 26, 192 size: 11, 11 orig: 11, 11 offset: 0, 0 index: -1 button rotate: false - xy: 520, 763 + xy: 520, 741 size: 12, 20 split: 5, 5, 5, 4 pad: 4, 4, 3, 3 @@ -236,6 +236,15 @@ button-over orig: 12, 20 offset: 0, 0 index: -1 +button-panel-bg + rotate: false + xy: 520, 829 + size: 12, 20 + split: 5, 5, 5, 4 + pad: 4, 4, 1, 1 + orig: 12, 20 + offset: 0, 0 + index: -1 button-red rotate: false xy: 21, 273 @@ -247,7 +256,7 @@ button-red index: -1 button-resource rotate: false - xy: 520, 807 + xy: 520, 785 size: 12, 20 split: 5, 5, 5, 4 pad: 4, 4, 1, 1 @@ -256,7 +265,7 @@ button-resource index: -1 button-resource-over rotate: false - xy: 520, 829 + xy: 520, 807 size: 12, 20 split: 5, 5, 5, 4 pad: 4, 4, 1, 1 @@ -265,7 +274,7 @@ button-resource-over index: -1 button-window-bg rotate: false - xy: 520, 785 + xy: 520, 763 size: 12, 20 split: 5, 5, 5, 4 pad: 4, 4, 1, 1 @@ -274,28 +283,28 @@ button-window-bg index: -1 check-down rotate: false - xy: 520, 692 + xy: 520, 670 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 check-down-on rotate: false - xy: 520, 676 + xy: 520, 654 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 check-off rotate: false - xy: 520, 660 + xy: 520, 638 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 textfield rotate: false - xy: 520, 660 + xy: 520, 638 size: 14, 14 split: 2, 2, 3, 2 orig: 14, 14 @@ -303,28 +312,28 @@ textfield index: -1 check-on rotate: false - xy: 520, 644 + xy: 520, 622 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 check-on-disabled rotate: false - xy: 520, 628 + xy: 520, 606 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 check-over-off rotate: false - xy: 520, 612 + xy: 520, 590 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 check-over-on rotate: false - xy: 520, 596 + xy: 520, 574 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -338,7 +347,7 @@ color-picker-bar-selector index: -1 color-picker-cross rotate: false - xy: 518, 495 + xy: 684, 951 size: 5, 5 orig: 5, 5 offset: 0, 0 @@ -352,7 +361,7 @@ color-picker-selector-horizontal index: -1 color-picker-selector-vertical rotate: false - xy: 26, 121 + xy: 706, 971 size: 1, 3 orig: 1, 3 offset: 0, 0 @@ -375,7 +384,7 @@ default-pane index: -1 default-pane-noborder rotate: false - xy: 390, 456 + xy: 16, 40 size: 1, 1 split: 0, 0, 0, 0 orig: 1, 1 @@ -445,7 +454,7 @@ expandable-properties-collapse-off index: -1 expandable-properties-collapse-on rotate: false - xy: 26, 132 + xy: 26, 119 size: 7, 7 orig: 7, 7 offset: 0, 0 @@ -495,7 +504,7 @@ icon-close-orange index: -1 icon-close-orange-down rotate: false - xy: 26, 151 + xy: 26, 138 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -516,7 +525,7 @@ icon-close-panel index: -1 icon-close-small rotate: false - xy: 708, 984 + xy: 536, 874 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -537,7 +546,7 @@ icon-composite index: -1 icon-composite2 rotate: false - xy: 520, 580 + xy: 520, 558 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -712,7 +721,7 @@ icon-refresh index: -1 icon-root rotate: false - xy: 520, 564 + xy: 520, 542 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -847,14 +856,14 @@ layer-bg-over index: -1 list-selection rotate: false - xy: 678, 942 + xy: 22, 46 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 list-selection-white rotate: false - xy: 518, 492 + xy: 62, 305 size: 1, 1 orig: 1, 1 offset: 0, 0 @@ -945,7 +954,7 @@ panel index: -1 popup-menu rotate: false - xy: 740, 994 + xy: 711, 977 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -953,7 +962,7 @@ popup-menu index: -1 popup-menu-disabled rotate: false - xy: 267, 387 + xy: 724, 993 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -961,7 +970,7 @@ popup-menu-disabled index: -1 popup-menu-down rotate: false - xy: 272, 388 + xy: 267, 387 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -969,7 +978,7 @@ popup-menu-down index: -1 popup-menu-over rotate: false - xy: 722, 985 + xy: 272, 388 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -984,7 +993,7 @@ progressbar index: -1 progressbar-filled rotate: false - xy: 530, 756 + xy: 530, 734 size: 1, 5 orig: 1, 5 offset: 0, 0 @@ -998,7 +1007,7 @@ progressbar-filled-vertical index: -1 progressbar-vertical rotate: false - xy: 549, 934 + xy: 2, 2 size: 5, 1 orig: 5, 1 offset: 0, 0 @@ -1054,7 +1063,7 @@ radio-over-on index: -1 scroll rotate: false - xy: 692, 974 + xy: 692, 968 size: 5, 6 split: 2, 2, 2, 2 orig: 5, 6 @@ -1062,7 +1071,7 @@ scroll index: -1 scroll-horizontal rotate: false - xy: 520, 509 + xy: 390, 458 size: 6, 5 split: 2, 2, 0, 5 pad: -1, -1, 2, 2 @@ -1071,7 +1080,7 @@ scroll-horizontal index: -1 scroll-knob-horizontal rotate: false - xy: 518, 502 + xy: 26, 112 size: 6, 5 split: 2, 2, 0, 5 pad: -1, -1, 2, 2 @@ -1080,7 +1089,7 @@ scroll-knob-horizontal index: -1 scroll-knob-vertical rotate: false - xy: 684, 966 + xy: 684, 958 size: 5, 6 split: 2, 2, 2, 2 orig: 5, 6 @@ -1088,42 +1097,42 @@ scroll-knob-vertical index: -1 select-box-list-bg rotate: false - xy: 525, 499 + xy: 72, 312 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 select-box-list-bg-white rotate: false - xy: 16, 40 + xy: 724, 990 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 select-down rotate: false - xy: 390, 459 + xy: 702, 976 size: 7, 4 orig: 7, 4 offset: 0, 0 index: -1 select-up rotate: false - xy: 26, 126 + xy: 398, 459 size: 7, 4 orig: 7, 4 offset: 0, 0 index: -1 selection rotate: false - xy: 22, 46 + xy: 277, 390 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 selection-anchor rotate: false - xy: 26, 194 + xy: 26, 181 size: 9, 9 orig: 9, 9 offset: 0, 0 @@ -1144,14 +1153,14 @@ separator-menu index: -1 separator-vertical rotate: false - xy: 730, 990 + xy: 390, 455 size: 2, 1 orig: 2, 1 offset: 0, 0 index: -1 slider rotate: false - xy: 691, 968 + xy: 546, 928 size: 1, 4 orig: 1, 4 offset: 0, 0 @@ -1186,7 +1195,7 @@ slider-knob-over index: -1 slider-vertical rotate: false - xy: 2, 2 + xy: 137, 338 size: 4, 1 orig: 4, 1 offset: 0, 0 @@ -1200,7 +1209,7 @@ splash_logo index: -1 splitpane rotate: false - xy: 137, 338 + xy: 549, 934 size: 4, 1 orig: 4, 1 offset: 0, 0 @@ -1214,14 +1223,14 @@ splitpane-over index: -1 splitpane-vertical rotate: false - xy: 699, 976 + xy: 26, 99 size: 1, 4 orig: 1, 4 offset: 0, 0 index: -1 splitpane-vertical-over rotate: false - xy: 399, 459 + xy: 684, 945 size: 1, 4 orig: 1, 4 offset: 0, 0 @@ -1259,7 +1268,7 @@ tab-active index: -1 tab-inactive rotate: false - xy: 520, 740 + xy: 520, 718 size: 8, 21 split: 3, 3, 2, 1 orig: 8, 21 @@ -1267,7 +1276,7 @@ tab-inactive index: -1 textfield-light rotate: false - xy: 520, 516 + xy: 272, 393 size: 14, 14 split: 3, 3, 4, 3 orig: 14, 14 @@ -1275,7 +1284,7 @@ textfield-light index: -1 textfield-light-down rotate: false - xy: 520, 548 + xy: 520, 526 size: 14, 14 split: 3, 3, 4, 3 orig: 14, 14 @@ -1283,7 +1292,7 @@ textfield-light-down index: -1 textfield-light-over rotate: false - xy: 520, 532 + xy: 520, 510 size: 14, 14 split: 3, 3, 4, 3 orig: 14, 14 @@ -1291,7 +1300,7 @@ textfield-light-over index: -1 textfield-over rotate: false - xy: 520, 532 + xy: 520, 510 size: 14, 14 split: 2, 2, 3, 2 orig: 14, 14 @@ -1315,7 +1324,7 @@ thumbnail-over index: -1 tint-border rotate: false - xy: 722, 990 + xy: 684, 966 size: 6, 6 split: 2, 2, 2, 2 orig: 6, 6 @@ -1372,7 +1381,7 @@ tool-transform index: -1 toolbar-bg rotate: false - xy: 730, 993 + xy: 692, 976 size: 8, 4 split: 1, 2, 1, 1 orig: 8, 4 @@ -1380,7 +1389,7 @@ toolbar-bg index: -1 toolbar-down rotate: false - xy: 26, 183 + xy: 26, 170 size: 8, 9 split: 2, 2, 3, 3 orig: 8, 9 @@ -1388,7 +1397,7 @@ toolbar-down index: -1 toolbar-normal rotate: false - xy: 26, 172 + xy: 26, 159 size: 8, 9 split: 2, 2, 3, 3 orig: 8, 9 @@ -1396,7 +1405,7 @@ toolbar-normal index: -1 toolbar-over rotate: false - xy: 26, 161 + xy: 26, 148 size: 8, 9 split: 2, 2, 3, 3 orig: 8, 9 @@ -1404,7 +1413,7 @@ toolbar-over index: -1 tooltip-bg rotate: false - xy: 546, 929 + xy: 407, 460 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -1419,14 +1428,14 @@ touchpad-knob index: -1 tree-minus rotate: false - xy: 26, 141 + xy: 26, 128 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 tree-over rotate: false - xy: 62, 305 + xy: 716, 979 size: 1, 1 orig: 1, 1 offset: 0, 0 @@ -1440,7 +1449,7 @@ tree-plus index: -1 tree-selection rotate: false - xy: 526, 502 + xy: 699, 969 size: 5, 5 split: 2, 2, 2, 2 pad: 1, 1, 1, 1 @@ -1449,91 +1458,91 @@ tree-selection index: -1 vis-blue rotate: false - xy: 72, 312 + xy: 500, 475 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 vis-check rotate: false - xy: 272, 393 + xy: 288, 394 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-check-down rotate: false - xy: 288, 394 + xy: 304, 394 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-check-over rotate: false - xy: 304, 394 + xy: 54, 258 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-check-tick rotate: false - xy: 54, 258 + xy: 652, 954 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-check-tick-disabled rotate: false - xy: 652, 954 + xy: 668, 954 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-radio rotate: false - xy: 668, 954 + xy: 320, 394 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-radio-down rotate: false - xy: 320, 394 + xy: 646, 938 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-radio-over rotate: false - xy: 646, 938 + xy: 662, 938 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-radio-tick rotate: false - xy: 662, 938 + xy: 692, 982 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-radio-tick-disabled rotate: false - xy: 692, 982 + xy: 708, 982 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 vis-red rotate: false - xy: 277, 390 + xy: 530, 731 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 white rotate: false - xy: 684, 961 + xy: 678, 940 size: 3, 3 orig: 3, 3 offset: 0, 0 @@ -1548,7 +1557,7 @@ window index: -1 window-bg rotate: false - xy: 727, 987 + xy: 242, 383 size: 1, 1 orig: 1, 1 offset: 0, 0 diff --git a/assets/style/uiskin.json b/assets/style/uiskin.json index 079087a5..d5b6c7a1 100644 --- a/assets/style/uiskin.json +++ b/assets/style/uiskin.json @@ -443,7 +443,9 @@ imageUp: icon-close-white }, close-panel: { - imageUp: icon-close-panel + down: button-red, + up: button-panel-bg, + imageUp: icon-close-white }, trash-button: { imageDown: icon-trash-disabled, @@ -763,7 +765,7 @@ com.kotcrab.vis.ui.widget.toast.Toast$ToastStyle: { default: { background: tooltip-bg, - closeButtonStyle: close-window + closeButtonStyle: close-panel }, dark: { background: window-bg, diff --git a/assets/style/uiskin.png b/assets/style/uiskin.png index fae18f2a..95a7a693 100644 Binary files a/assets/style/uiskin.png and b/assets/style/uiskin.png differ diff --git a/hyperlap2d-common-api/src/main/java/games/rednblack/h2d/common/UIDraggablePanel.java b/hyperlap2d-common-api/src/main/java/games/rednblack/h2d/common/UIDraggablePanel.java index d849fd19..6fa4e52c 100644 --- a/hyperlap2d-common-api/src/main/java/games/rednblack/h2d/common/UIDraggablePanel.java +++ b/hyperlap2d-common-api/src/main/java/games/rednblack/h2d/common/UIDraggablePanel.java @@ -18,8 +18,10 @@ package games.rednblack.h2d.common; import com.badlogic.gdx.scenes.scene2d.Actor; +import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; +import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.utils.Align; import com.kotcrab.vis.ui.VisUI; import com.kotcrab.vis.ui.widget.VisDialog; @@ -45,15 +47,13 @@ public class UIDraggablePanel extends H2DDialog { @Override public void addCloseButton() { VisImageButton closeButton = new VisImageButton("close-panel"); - this.getTitleTable().add(closeButton).padBottom(2); - closeButton.addListener(new ChangeListener() { - public void changed(ChangeEvent event, Actor actor) { + this.getTitleTable().add(closeButton).padTop(1).padRight(-2); + closeButton.addListener(new ClickListener() { + @Override + public void clicked(InputEvent event, float x, float y) { UIDraggablePanel.this.close(); } }); - if (this.getTitleTable().getChildren().size == 2) { - this.getTitleTable().getCell(this.getTitleLabel()).padLeft(closeButton.getWidth() * 2.0F); - } } public void invalidateHeight() {