Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
Add a hack to fix the reappearing button
Browse files Browse the repository at this point in the history
  • Loading branch information
spikespaz committed Aug 27, 2019
1 parent 650394b commit 97e4358
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions source/configure.d
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ struct ConfigApp {
JSONValue releaseJson;
JSONValue releaseAsset;

bool browserPathButtonHidden = true;

void createWindow() {
debug writeln("ConfigApp.createWindow()");

Expand All @@ -90,12 +92,27 @@ struct ConfigApp {
this.bindConfigPageListeners();
this.bindUpdatePageListeners();

// And a fix for the "..." button mysteriously appearing after switching tabs
this.tabs.addDirectEventListener(EventType.click, (Event event) {
auto t = (event.clientX / 80); // 80 = tab width
if (!(event.clientY < Window.lineHeight && t >= 0 && t < this.tabs.children.length))
return;

debug writeln("Tabs changed");

if (this.browserPathButtonHidden)
this.browserPathButton.hide();
else
this.browserPathButton.show();
});

// Little hack to mitigate issue #51
this.tabs.setCurrentTab(1);
this.tabs.setCurrentTab(0);

// And this for good measure
this.browserPathButton.hide();
this.browserPathButtonHidden = true;
}

bool shouldUpdate() {
Expand Down Expand Up @@ -156,6 +173,7 @@ struct ConfigApp {
this.browserPathButton = new Button("...", hLayout0);
this.browserPathButton.setMaxWidth(30);
this.browserPathButton.hide();
this.browserPathButtonHidden = true;

vSpacer = new VerticalSpacer(layout);
vSpacer.setMaxHeight(8);
Expand Down Expand Up @@ -311,11 +329,13 @@ struct ConfigApp {
if (this.browserSelect.currentText == "Custom") {
this.browserPath.setEnabled(true);
this.browserPathButton.show();
this.browserPathButtonHidden = true;

browserPath.content = "";
} else {
this.browserPath.setEnabled(false);
this.browserPathButton.hide();
this.browserPathButtonHidden = true;

this.browserPath.content = this.browsers.get(this.browserSelect.currentText, "");
}
Expand Down

0 comments on commit 97e4358

Please sign in to comment.