From f5ab6255d018bb1944f8efa0bae84504052aa03f Mon Sep 17 00:00:00 2001 From: alpha123 Date: Mon, 26 Aug 2013 03:06:08 +0000 Subject: [PATCH] General scrollbar improvements. Patch by Josh. Fixes #2080. - Don't show the scrollbar when the contents aren't overflowing the visible area. - Fix bugs in minimum bar sizing. - Add capability to set a maximum bar size. - Correct outdated/incorrect comments. This was SVN commit r13771. --- binaries/data/mods/public/gui/gui.dtd | 1 + .../public/gui/session/selection_details.js | 638 +++++++++--------- .../data/mods/public/gui/session/session.xml | 72 +- .../simulation/components/GuiInterface.js | 289 ++++---- .../simulation/components/ResourceSupply.js | 212 ++++-- .../components/StatisticsTracker.js | 20 +- .../templates/gaia/flora_tree_apple.xml | 3 + .../template_gaia_flora_bush_berry.xml | 19 +- .../templates/template_unit_fauna_fish.xml | 8 +- source/gui/CGUI.cpp | 9 + source/gui/CGUIScrollBarVertical.cpp | 60 +- source/gui/CGUIScrollBarVertical.h | 2 +- source/gui/IGUIScrollBar.cpp | 37 +- source/gui/IGUIScrollBar.h | 19 +- 14 files changed, 776 insertions(+), 613 deletions(-) diff --git a/binaries/data/mods/public/gui/gui.dtd b/binaries/data/mods/public/gui/gui.dtd index 8b0799ddc3..8c30c22804 100644 --- a/binaries/data/mods/public/gui/gui.dtd +++ b/binaries/data/mods/public/gui/gui.dtd @@ -135,6 +135,7 @@ sprite_bar_vertical_pressed CDATA #IMPLIED sprite_back_vertical CDATA #IMPLIED minimum_bar_size CDATA #IMPLIED + maximum_bar_size CDATA #IMPLIED > stopUnits(g_Selection.toList()); - + addTrainingByPosition(0); @@ -202,7 +202,7 @@ addTrainingByPosition(3); - + addTrainingByPosition(4); @@ -315,7 +315,7 @@ - + @@ -442,7 +442,7 @@ z="200" > Settings - + if (renderer.shadows) this.checked = true; else this.checked = false; renderer.shadows = this.checked; - + Enable Shadow Filtering if (renderer.shadowPCF) this.checked = true; else this.checked = false; renderer.shadowPCF = this.checked; - + Water - HQ Waviness if (renderer.waternormal) this.checked = true; else this.checked = false; renderer.waternormal = this.checked; - + Water - Use Actual Depth @@ -481,28 +481,28 @@ if (renderer.waterreflection) this.checked = true; else this.checked = false; renderer.waterreflection = this.checked; - + Water - Enable Refraction if (renderer.waterrefraction) this.checked = true; else this.checked = false; renderer.waterrefraction = this.checked; - + Water - Enable Shore Foam if (renderer.waterfoam) this.checked = true; else this.checked = false; renderer.waterfoam = this.checked; - + Water - Enable Shore Waves if (renderer.watercoastalwaves) this.checked = true; else this.checked = false; renderer.watercoastalwaves = this.checked; - + Water - Use Surface Shadows @@ -516,27 +516,27 @@ if (renderer.particles) this.checked = true; else this.checked = false; renderer.particles = this.checked; - + Enable Unit Silhouettes if (renderer.silhouettes) this.checked = true; else this.checked = false; renderer.silhouettes = this.checked; - + Enable Music if (this.checked) global.music.start(); else global.music.stop(); - + Developer Overlay toggleDeveloperOverlay(); - + -