Skip to content

Commit 73c41a1

Browse files
committed
HideHL/Texture: add tooltips on toolbar buttons
1 parent d35caf8 commit 73c41a1

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

hide_hl/hide/view/Texture.hx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class HuiHistogramRange extends HuiElement {
7878
<hui-icon("diamond") class="handle" id="handle-range-end"/>
7979
</hui-element>
8080
<hui-input-box id="input-range-end" class="group"/>
81-
<hui-button class="group" id="reset-range"><hui-icon("back_arrow")/></hui-button>
82-
<hui-button class="group"><hui-icon("histogram")/></hui-button>
83-
<hui-toggle class="group-end" id="linear-tog"><hui-icon("gamma")/></hui-toggle>
81+
<hui-button class="group" id="reset-range" tip={"Reset range"}><hui-icon("back_arrow")/></hui-button>
82+
<hui-button class="group" tip={"Toggle histogram range display"}><hui-icon("histogram")/></hui-button>
83+
<hui-toggle class="group-end" id="linear-tog" tip={"Toggle linear space"}><hui-icon("gamma")/></hui-toggle>
8484
</hui-histogram-range>
8585

8686
var curMin = 0.;
@@ -398,24 +398,22 @@ class Texture extends HuiView<{path: String}> {
398398
override function getToolbarWidgets() : Array<HuiElement> {
399399
var widgets : Array<HuiElement> = super.getToolbarWidgets();
400400

401-
var helpBtn = new HuiButton();
402-
helpBtn.onClick = (_) -> {
403-
uiBase.addPopup(new hrt.ui.HuiToolbar.HuiHelpPopup(this.registeredCommands), { object: Element(helpBtn), directionX: StartInside, directionY: EndOutside });
404-
};
405-
406401
var compressedBtn = new HuiToggle();
407402
compressedBtn.dom.addClass("group-start");
408403
compressedBtn.toggled = true;
404+
compressedBtn.tip = "Show compressed texture";
409405
new HuiIcon("raw_off", compressedBtn);
410406
widgets.push(compressedBtn);
411407

412408
var uncompressedBtn = new HuiToggle();
413409
uncompressedBtn.dom.addClass("group");
410+
uncompressedBtn.tip = "Show raw texture";
414411
new HuiIcon("raw", uncompressedBtn);
415412
widgets.push(uncompressedBtn);
416413

417414
var compareBtn = new HuiToggle();
418415
compareBtn.dom.addClass("group-end");
416+
compareBtn.tip = "Show comparison between compressed and raw texture";
419417
new HuiIcon("compare", compareBtn);
420418
widgets.push(compareBtn);
421419

@@ -447,6 +445,7 @@ class Texture extends HuiView<{path: String}> {
447445

448446
var rChannelBtn = new HuiToggle();
449447
rChannelBtn.toggled = true;
448+
rChannelBtn.tip = "Toggle Red channel";
450449
rChannelBtn.dom.addClass("group-start");
451450
new HuiText("R", rChannelBtn);
452451
rChannelBtn.onClick = (_) -> {
@@ -457,6 +456,7 @@ class Texture extends HuiView<{path: String}> {
457456

458457
var gChannelBtn = new HuiToggle();
459458
gChannelBtn.toggled = true;
459+
gChannelBtn.tip = "Toggle Green channel";
460460
gChannelBtn.dom.addClass("group");
461461
new HuiText("G", gChannelBtn);
462462
gChannelBtn.onClick = (_) -> {
@@ -467,6 +467,7 @@ class Texture extends HuiView<{path: String}> {
467467

468468
var bChannelBtn = new HuiToggle();
469469
bChannelBtn.toggled = true;
470+
bChannelBtn.tip = "Toggle Blue channel";
470471
bChannelBtn.dom.addClass("group");
471472
new HuiText("B", bChannelBtn);
472473
bChannelBtn.onClick = (_) -> {
@@ -477,6 +478,7 @@ class Texture extends HuiView<{path: String}> {
477478

478479
var aChannelBtn = new HuiToggle();
479480
aChannelBtn.toggled = true;
481+
aChannelBtn.tip = "Toggle Alpha channel";
480482
aChannelBtn.dom.addClass("group-end");
481483
new HuiText("A", aChannelBtn);
482484
aChannelBtn.onClick = (_) -> {
@@ -487,6 +489,7 @@ class Texture extends HuiView<{path: String}> {
487489

488490
var flipBtn = new HuiToggle();
489491
flipBtn.toggled = false;
492+
flipBtn.tip = "Flip texture";
490493
new HuiIcon("vertical_arrows", flipBtn);
491494
flipBtn.onClick = (_) -> {
492495
flipBtn.toggled = !flipBtn.toggled;
@@ -497,6 +500,7 @@ class Texture extends HuiView<{path: String}> {
497500

498501
var resetZoomBtn = new HuiButton();
499502
resetZoomBtn.dom.addClass("group-start");
503+
resetZoomBtn.tip = "Reset zoom";
500504
new HuiIcon("scale1_1", resetZoomBtn);
501505
resetZoomBtn.onClick = (_) -> {
502506
zoom = 1;
@@ -506,6 +510,7 @@ class Texture extends HuiView<{path: String}> {
506510

507511
var fitBtn = new HuiButton();
508512
fitBtn.dom.addClass("group");
513+
fitBtn.tip = "Fit";
509514
new HuiIcon("fullscreen", fitBtn);
510515
fitBtn.onClick = (_) -> {
511516
fit();
@@ -544,6 +549,11 @@ class Texture extends HuiView<{path: String}> {
544549
var histogram = new HuiHistogramRange(this);
545550
widgets.push(histogram);
546551

552+
var helpBtn = new HuiButton();
553+
helpBtn.tip = "Show help";
554+
helpBtn.onClick = (_) -> {
555+
uiBase.addPopup(new hrt.ui.HuiToolbar.HuiHelpPopup(this.registeredCommands), { object: Element(helpBtn), directionX: StartInside, directionY: EndOutside });
556+
};
547557
new HuiIcon("question_mark", helpBtn);
548558
widgets.push(helpBtn);
549559

0 commit comments

Comments
 (0)