diff --git a/background.js b/background.js index b6113d55..32cbac15 100644 --- a/background.js +++ b/background.js @@ -1,11 +1,7 @@ function start_app() { chrome.app.window.create('main.html', { - frame: 'chrome', id: 'main-window', - minWidth: 960, - maxWidth: 960, - minHeight: 600, - maxHeight: 600 + resizable: false }, function(window_child) { window_child.onClosed.addListener(function() { // connectionId is passed from the script side through the chrome.runtime.getBackgroundPage refference diff --git a/changelog.html b/changelog.html index e6474b1b..73fd6ec1 100644 --- a/changelog.html +++ b/changelog.html @@ -1,5 +1,6 @@ xx.xx.xxxx - 0.21

+ - Handle small screen resolutions more gracefully
- Bugfix for Servo tab save button & CAMSTAB

12.16.2013 - 0.20 diff --git a/main.js b/main.js index 6b806b8d..105c5650 100644 --- a/main.js +++ b/main.js @@ -14,7 +14,15 @@ var ga_tracker = service.getTracker('UA-32728876-6'); ga_tracker.sendAppView('Application Started'); // Google Analytics stuff end -$(document).ready(function() { +$(document).ready(function() { + // set bounds (default 960x600) + if (screen.height > 600) { + chrome.app.window.current().setBounds({width: 960, height: 600}); + } else { + $('div#content').height(280); + chrome.app.window.current().setBounds({width: 960, height: 400}); + } + var tabs = $('#tabs > ul'); $('a', tabs).click(function() { if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active diff --git a/tabs/auxiliary_configuration.css b/tabs/auxiliary_configuration.css index 64e22e55..9876f3c9 100644 --- a/tabs/auxiliary_configuration.css +++ b/tabs/auxiliary_configuration.css @@ -2,6 +2,7 @@ } .tab-auxiliary_configuration .heads { + float: right; } .tab-auxiliary_configuration .heads li { float: left; @@ -20,7 +21,6 @@ background-color: #ececec; } .tab-auxiliary_configuration .heads li:first-child { - margin-left: 181px; border-left: 1px solid #8b8b8b; } .tab-auxiliary_configuration .heads li:nth-child(3) { diff --git a/tabs/cli.css b/tabs/cli.css index 8b4b9237..b5d1fc31 100644 --- a/tabs/cli.css +++ b/tabs/cli.css @@ -25,7 +25,6 @@ margin-top: 8px; display: block; - width: 911px; height: 20px; line-height: 20px; diff --git a/tabs/cli.js b/tabs/cli.js index aa135d9f..92d533c8 100644 --- a/tabs/cli.js +++ b/tabs/cli.js @@ -61,6 +61,14 @@ function tab_initialize_cli() { textarea.val(cli_history.next()); }); + // handle smaller resolutions + if (screen.height <= 600) { + $('div.tab-cli .window').height(200); + } + + // apply dynamic width to the textarea element according to cli window width (minus padding and border width) + $('div.tab-cli textarea').width($('div.tab-cli .window').outerWidth() - 7); + // give input element user focus $('.tab-cli textarea').focus(); diff --git a/tabs/default.css b/tabs/default.css index e69de29b..968c042e 100644 --- a/tabs/default.css +++ b/tabs/default.css @@ -0,0 +1,101 @@ + .welcome { + float: left; + + width: 494px; + height: 171px; + + padding: 5px; + + border: 1px solid silver; + } + .welcome a { + font-weight: bold; + } + .changelog { + margin-left: 514px; + margin-bottom: 10px; + + border: 1px solid silver; + } + .changelog .title { + line-height: 20px; + + text-align: center; + font-weight: bold; + color: white; + + border-bottom: 1px solid silver; + background-color: #3f4241; + } + .changelog .wrapper { + height: 150px; + + padding: 5px; + + overflow-y: scroll; + overflow-x: hidden; + + -webkit-user-select: text; + } + .changelog .wrapper span { + font-weight: bold; + } + .changelog .wrapper p { + margin-bottom: 5px; + } + .donate { + float: left; + + width: 504px; + + padding: 0 0 5px 0; + + border: 1px solid silver; + } + .donate .title { + line-height: 20px; + + text-align: center; + font-weight: bold; + color: white; + + border-bottom: 1px solid silver; + background-color: #3f4241; + } + .donate p { + padding: 5px; + } + .donate a { + display: block; + + width: 74px; + height: 21px; + + margin: auto; + } + .firmware_flasher { + display: block; + float: right; + + height: 28px; + line-height: 28px; + + padding: 0 15px 0 15px; + + text-align: center; + font-weight: bold; + + border: 1px solid silver; + background-color: #ececec; + } + .firmware_flasher:hover { + background-color: #dedcdc; + } + .created { + position: absolute; + + width: 920px; + bottom: 5px; + + text-align: center; + } \ No newline at end of file diff --git a/tabs/default.html b/tabs/default.html index 6af066d8..b7a08d22 100644 --- a/tabs/default.html +++ b/tabs/default.html @@ -1,111 +1,3 @@ -
This application is a configuration utility for baseflight, a 32 bit fork of the popular open source RC flight control firmware project MultiWii.
diff --git a/tabs/default.js b/tabs/default.js index 3452e6e3..8e917acd 100644 --- a/tabs/default.js +++ b/tabs/default.js @@ -2,6 +2,11 @@ function tab_initialize_default() { $('#content').load("./tabs/default.html", function() { GUI.active_tab = 'default'; + // handle smaller resolution + if (screen.height <= 600) { + $('p.created').hide(); + } + // load changelog content $('div.changelog.configurator .wrapper').load('./changelog.html'); diff --git a/tabs/motor_outputs.css b/tabs/motor_outputs.css index 2759e8c2..26b4a19b 100644 --- a/tabs/motor_outputs.css +++ b/tabs/motor_outputs.css @@ -64,7 +64,7 @@ .tab-motor_outputs .motor_testing .notice { float: right; - width: 490px; + width: 480px; margin-top: 20px; padding: 5px; diff --git a/tabs/receiver.css b/tabs/receiver.css index bfa16922..b5bfb852 100644 --- a/tabs/receiver.css +++ b/tabs/receiver.css @@ -22,12 +22,11 @@ border: 1px solid silver; } .tab-receiver .bars .value { - width: 60px; + width: 50px; padding-left: 20px; } .tab-receiver .tunings { - float: left; - border: 1p xsolid red; + float: right; } .tab-receiver .tunings table { width: 30%; @@ -83,11 +82,11 @@ width: 880px; height: 250px; } - .tab-receiver .throttle_curve { + .tab-receiver .curves { float: right; - - margin-bottom: 20px; - margin-right: 10px; + } + .tab-receiver .throttle_curve { + margin: 0 10px 20px 10px; width: 220px; height: 58px; @@ -95,10 +94,8 @@ border: 1px solid silver; } .tab-receiver .pitch_roll_curve { - float: right; - - margin-right: 10px; - + margin: 0 10px 0 10px; + width: 220px; height: 58px; diff --git a/tabs/receiver.html b/tabs/receiver.html index 24ddc93a..6eb6290d 100644 --- a/tabs/receiver.html +++ b/tabs/receiver.html @@ -41,6 +41,14 @@
  • +
    +
    + +
    +
    + +
    +
    @@ -64,12 +72,6 @@
    Save
    -
    - -
    -
    - -