Skip to content

Commit

Permalink
Improved how to switch the window
Browse files Browse the repository at this point in the history
- Added dedicated transparent fullscreen rectangle as click target
  • Loading branch information
tanstaaflFH committed Jul 26, 2018
1 parent 169d423 commit ab27fc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { goals } from "user-activity";
import { StatsObject } from "../common/WidgetStats";
import { display } from "display";

// get handler to the ;BG window
var bgWindow = document.getElementById("bgWindow");
// get handler to the click Target rectangle
var clickTarget = document.getElementById("clickTarget");
var bShowMainWindow = true;

// get the standard BG line width
Expand Down Expand Up @@ -112,7 +112,7 @@ battery.onchange = function() {
};

// click event for the; Background Window
bgWindow.onclick = function() {
clickTarget.onclick = function() {

// toggle global variable showing which elements shall be shown
bShowMainWindow = !bShowMainWindow;
Expand Down
5 changes: 4 additions & 1 deletion resources/index.gui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<svg id="bgWindow" pointer-events="all" class="background" >
<svg id="bgWindow" class="background" >

// *** CLOCK ***

Expand Down Expand Up @@ -74,4 +74,7 @@
<image id="ProgStarDistance" x="255" y="195" href="Star 16x16.png" load="sync" class="statArcStar" />
<text id="txtDistance" x="235" y="250" class="txtStatsSmall secondPage" />

// * Dedicated click target *
<rect id="clickTarget" pointer-events="all" x="0" y="0" width="100%" height="100%" opacity="0" />

</svg>

0 comments on commit ab27fc1

Please sign in to comment.