Skip to content

Commit

Permalink
Rewrote the UI code, it's now GridLayout based. Added Scrollbars and …
Browse files Browse the repository at this point in the history
…more customizable landing settings. Closes #21, closes #17
  • Loading branch information
BeneSim committed Jun 30, 2017
1 parent 0424301 commit a9de191
Show file tree
Hide file tree
Showing 51 changed files with 1,159 additions and 2,764 deletions.
25 changes: 15 additions & 10 deletions data_resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
<file>html/css/beneoverlay.css</file>
<file>html/js/beneoverlay.js</file>
<file>html/js/jquery.min.js</file>
<file>html/js/landing.js</file>
<file>html/js/progress.js</file>
<file>html/js/landing/title.js</file>
<file>html/js/landing/rate.js</file>
<file>html/js/landing/speed.js</file>
<file>html/js/landing/attitude.js</file>
<file>html/js/landing/landing.js</file>
<file>html/js//progress/progress.js</file>
<file>html/js/qwebchannel.js</file>
<file>html/landing.html</file>
<file>html/progress.html</file>
<file>html/js/altitude.js</file>
<file>html/js/callsign.js</file>
<file>html/js/heading.js</file>
<file>html/js/network.js</file>
<file>html/js/performance.js</file>
<file>html/js/speed.js</file>
<file>html/js/wind.js</file>
<file>html/js/widgets/altitude.js</file>
<file>html/js/widgets/callsign.js</file>
<file>html/js/widgets/heading.js</file>
<file>html/js/widgets/network.js</file>
<file>html/js/widgets/performance.js</file>
<file>html/js/widgets/speed.js</file>
<file>html/js/widgets/wind.js</file>
<file>html/js/widgets/widgets.js</file>
<file>html/altitude.html</file>
<file>html/callsign.html</file>
<file>html/heading.html</file>
Expand All @@ -27,6 +32,6 @@
<file>html/wind.html</file>
<file>html/widgets.html</file>
<file>html/temperature.html</file>
<file>html/js/temperature.js</file>
<file>html/js/widgets/temperature.js</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion html/altitude.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script type="text/javascript" src="js/qwebchannel.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/beneoverlay.js"></script>
<script type="text/javascript" src="js/altitude.js"></script>
<script type="text/javascript" src="js/widgets/altitude.js"></script>
<script type="text/javascript">
$(function () {
connect(function (data_refs) {
Expand Down
2 changes: 1 addition & 1 deletion html/callsign.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script type="text/javascript" src="js/qwebchannel.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/beneoverlay.js"></script>
<script type="text/javascript" src="js/callsign.js"></script>
<script type="text/javascript" src="js/widgets/callsign.js"></script>
<script type="text/javascript">
$(function () {
connect(function (data_refs) {
Expand Down
2 changes: 1 addition & 1 deletion html/heading.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<script type="text/javascript" src="js/qwebchannel.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/beneoverlay.js"></script>
<script type="text/javascript" src="js/heading.js"></script>
<script type="text/javascript" src="js/widgets/heading.js"></script>
<script type="text/javascript">
$(function () {
connect(function (data_refs) {
Expand Down
35 changes: 35 additions & 0 deletions html/js/landing/attitude.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* Copyright (C) 2017 Benjamin Isbarn.
This file is part of BeneOverlay.
BeneOverlay is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BeneOverlay is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BeneOverlay. If not, see <http://www.gnu.org/licenses/>.
*/

function setupAttitude(data_refs) {
setupCustomStyle(
$("#attitude"),
{
"custom_style": data_refs["landing/attitude/custom_style"],
"icon_enabled": data_refs["landing/attitude/icon_enabled"],
"icon_size": data_refs["landing/attitude/icon_size"],
"primary_color": data_refs["landing/attitude/primary_color"],
"secondary_color": data_refs["landing/attitude/secondary_color"],
"primary_font": data_refs["landing/attitude/primary_font"],
"secondary_font": data_refs["landing/attitude/secondary_font"]
},
data_refs
);

attachToToggle($("#bank-row"), data_refs["landing/attitude/bank_enabled"]);
}
38 changes: 17 additions & 21 deletions html/js/landing.js → html/js/landing/landing.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@
*/

function setupLanding(data_refs) {
setupCustomStyle(
$("#landing"),
{
"custom_style": data_refs["landing/custom_style"],
"icon_enabled": data_refs["landing/icon_enabled"],
"icon_size": data_refs["landing/icon_size"],
"primary_color": data_refs["landing/primary_color"],
"secondary_color": data_refs["landing/secondary_color"],
"primary_font": data_refs["landing/primary_font"],
"secondary_font": data_refs["landing/secondary_font"]
},
data_refs
);
setupTitle(data_refs);
setupRate(data_refs);
setupSpeed(data_refs);
setupAttitude(data_refs);

attachToToggle($("#title"), data_refs["landing/title/enabled"]);
attachToToggle($("#rate"), data_refs["landing/rate/enabled"]);
attachToToggle($("#speed"), data_refs["landing/speed/enabled"]);
attachToToggle($("#attitude"), data_refs["landing/attitude/enabled"]);


function updateBackgroundImage() {
if (data_refs["landing/background_image_enabled"].data) {
Expand All @@ -43,13 +40,13 @@ function setupLanding(data_refs) {
attachToFun(updateBackgroundImage, data_refs["landing/background_image_enabled"]);

function setVisible(val) {
if (val) {
$("#landing").fadeIn("fast");
$("#background").fadeIn("fast");
} else {
$("#landing").fadeOut("slow");
$("#background").fadeOut("slow");
}
if (val) {
$("#landing").fadeIn("fast");
$("#background").fadeIn("fast");
} else {
$("#landing").fadeOut("slow");
$("#background").fadeOut("slow");
}
}

attachToFun(setVisible, data_refs["landing/settings_mode"]);
Expand Down Expand Up @@ -82,5 +79,4 @@ function setupLanding(data_refs) {

}
});

}
36 changes: 36 additions & 0 deletions html/js/landing/rate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* Copyright (C) 2017 Benjamin Isbarn.
This file is part of BeneOverlay.
BeneOverlay is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BeneOverlay is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BeneOverlay. If not, see <http://www.gnu.org/licenses/>.
*/

function setupRate(data_refs) {
setupCustomStyle(
$("#rate"),
{
"custom_style": data_refs["landing/rate/custom_style"],
"icon_enabled": data_refs["landing/rate/icon_enabled"],
"icon_size": data_refs["landing/rate/icon_size"],
"primary_color": data_refs["landing/rate/primary_color"],
"secondary_color": data_refs["landing/rate/secondary_color"],
"primary_font": data_refs["landing/rate/primary_font"],
"secondary_font": data_refs["landing/rate/secondary_font"]
},
data_refs
);

attachToToggle($("#vs-row"), data_refs["landing/rate/vs_enabled"]);
attachToToggle($("#pitch-row"), data_refs["landing/rate/pitch_enabled"]);
}
36 changes: 36 additions & 0 deletions html/js/landing/speed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* Copyright (C) 2017 Benjamin Isbarn.
This file is part of BeneOverlay.
BeneOverlay is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BeneOverlay is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BeneOverlay. If not, see <http://www.gnu.org/licenses/>.
*/

function setupSpeed(data_refs) {
setupCustomStyle(
$("#speed"),
{
"custom_style": data_refs["landing/speed/custom_style"],
"icon_enabled": data_refs["landing/speed/icon_enabled"],
"icon_size": data_refs["landing/speed/icon_size"],
"primary_color": data_refs["landing/speed/primary_color"],
"secondary_color": data_refs["landing/speed/secondary_color"],
"primary_font": data_refs["landing/speed/primary_font"],
"secondary_font": data_refs["landing/speed/secondary_font"]
},
data_refs
);

attachToToggle($("#ias-row"), data_refs["landing/speed/ias_enabled"]);
attachToToggle($("#gs-row"), data_refs["landing/speed/gs_enabled"]);
}
33 changes: 33 additions & 0 deletions html/js/landing/title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright (C) 2017 Benjamin Isbarn.
This file is part of BeneOverlay.
BeneOverlay is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
BeneOverlay is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BeneOverlay. If not, see <http://www.gnu.org/licenses/>.
*/

function setupTitle(data_refs) {
setupCustomStyle(
$("#title"),
{
"custom_style": data_refs["landing/title/custom_style"],
"icon_enabled": data_refs["landing/title/icon_enabled"],
"icon_size": data_refs["landing/title/icon_size"],
"primary_color": data_refs["landing/title/primary_color"],
"secondary_color": data_refs["landing/title/secondary_color"],
"primary_font": data_refs["landing/title/primary_font"],
"secondary_font": data_refs["landing/title/secondary_font"]
},
data_refs
);
}
1 change: 1 addition & 0 deletions html/js/progress.js → html/js/progress/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function setupProgress(data_refs) {
attachToToggle($("#dtg-row"), data_refs["progress/dtg_enabled"]);
attachToToggle($("#eta-row"), data_refs["progress/eta_enabled"]);
attachToToggle($("#ete-row"), data_refs["progress/ete_enabled"]);
attachToToggle($("#route"), data_refs["progress/route_enabled"]);

function setProgressBarViewBox() {
let width = $("#progress_bar").width();
Expand Down
1 change: 0 additions & 1 deletion html/js/altitude.js → html/js/widgets/altitude.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupAltitude(data_refs) {
data_refs
);

attachToToggle($("#altitude"), data_refs["widget/altitude/enabled"]);
attachToToggle($("#alt-row"), data_refs["widget/altitude/alt_enabled"]);
attachToToggle($("#vs-row"), data_refs["widget/altitude/vs_enabled"]);

Expand Down
1 change: 0 additions & 1 deletion html/js/callsign.js → html/js/widgets/callsign.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupCallsign(data_refs) {
data_refs
);

attachToToggle($("#callsign"), data_refs["widget/callsign/enabled"]);
attachToToggle($("#callsign-row"), data_refs["widget/callsign/callsign_enabled"]);
attachToToggle($("#airline-row"), data_refs["widget/callsign/airline_enabled"]);

Expand Down
1 change: 0 additions & 1 deletion html/js/heading.js → html/js/widgets/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupHeading(data_refs) {
data_refs
);

attachToToggle($("#heading"), data_refs["widget/heading/enabled"]);
attachToToggle($("#hdg-row"), data_refs["widget/heading/hdg_enabled"]);
attachToToggle($("#trk-row"), data_refs["widget/heading/trk_enabled"]);

Expand Down
1 change: 0 additions & 1 deletion html/js/network.js → html/js/widgets/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupNetwork(data_refs) {
data_refs
);

attachToToggle($("#network"), data_refs["widget/network/enabled"]);
attachToToggle($("#network-row"), data_refs["widget/network/network_enabled"]);
attachToToggle($("#aircraft-row"), data_refs["widget/network/aircraft_enabled"]);

Expand Down
1 change: 0 additions & 1 deletion html/js/performance.js → html/js/widgets/performance.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupPerformance(data_refs) {
data_refs
);

attachToToggle($("#performance"), data_refs["widget/performance/enabled"]);
attachToToggle($("#fps-row"), data_refs["widget/performance/fps_enabled"]);
attachToToggle($("#vas-row"), data_refs["widget/performance/vas_enabled"]);

Expand Down
1 change: 0 additions & 1 deletion html/js/speed.js → html/js/widgets/speed.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupSpeed(data_refs) {
data_refs
);

attachToToggle($("#speed"), data_refs["widget/speed/enabled"]);
attachToToggle($("#ias-row"), data_refs["widget/speed/ias_enabled"]);
attachToToggle($("#tas-row"), data_refs["widget/speed/tas_enabled"]);
attachToToggle($("#gs-row"), data_refs["widget/speed/gs_enabled"]);
Expand Down
1 change: 0 additions & 1 deletion html/js/temperature.js → html/js/widgets/temperature.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupTemperature(data_refs) {
data_refs
);

attachToToggle($("#temperature"), data_refs["widget/temperature/enabled"]);
attachToToggle($("#tat-row"), data_refs["widget/temperature/tat_enabled"]);
attachToToggle($("#oat-row"), data_refs["widget/temperature/oat_enabled"]);

Expand Down
19 changes: 19 additions & 0 deletions html/js/widgets/widgets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function setupWidgets(data_refs) {
setupCallsign(data_refs);
setupNetwork(data_refs);
setupSpeed(data_refs);
setupHeading(data_refs);
setupAltitude(data_refs);
setupWind(data_refs);
setupTemperature(data_refs);
setupPerformance(data_refs);

attachToToggle($("#callsign"), data_refs["widget/callsign/enabled"]);
attachToToggle($("#network"), data_refs["widget/network/enabled"]);
attachToToggle($("#speed"), data_refs["widget/speed/enabled"]);
attachToToggle($("#heading"), data_refs["widget/heading/enabled"]);
attachToToggle($("#altitude"), data_refs["widget/altitude/enabled"]);
attachToToggle($("#wind"), data_refs["widget/wind/enabled"]);
attachToToggle($("#temperature"), data_refs["widget/temperature/enabled"]);
attachToToggle($("#performance"), data_refs["widget/performance/enabled"]);
}
1 change: 0 additions & 1 deletion html/js/wind.js → html/js/widgets/wind.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function setupWind(data_refs) {
data_refs
);

attachToToggle($("#wind"), data_refs["widget/wind/enabled"]);
attachToToggle($("#dir-row"), data_refs["widget/wind/dir_enabled"]);
attachToToggle($("#mag-row"), data_refs["widget/wind/mag_enabled"]);

Expand Down
Loading

0 comments on commit a9de191

Please sign in to comment.