From 265c90e57ffa47a6f2dac70c8a864434d514d5c7 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Fri, 17 Feb 2012 00:01:31 +1100 Subject: [PATCH] dd fullscreen toggle button to solve some usability issues (eg http://trac.openstreetmap.org/ticket/4002) A few things to note: 1. I haven't actually tested this, because my local environment doesn't have the real maximise/minimise frame. But I've stepped through the code, and it looks ok. 2. The icon could be prettier. 3. I'm making use of EditController.toggleSize() which was marked private. Someo ne wise should review this. 4. There should probably be some vigorous debate any time a new toolbar icon is added. 5. The button is always enabled, and doesn't change to match state. I tried to make it do that, but I don't know the Flex event stuff well enough. My attempts are included below. I'm committing the alternative state .svg in case it's useful, although it's currently unused. In potlatch2.mxml (button id="fullscreen") toggle="true" selected="{Application.application.theController.isMaximised()}" selectedUpIcon="@Embed('embedded/fullscreen-toggle.svg')" selectedDownIcon="@Embed('embedded/fullscreen-toggle.svg')" selectedOverIcon="@Embed('embedded/fullscreen-toggle.svg')" EditController.isMaximised() [Bindable(event="is_maximised")] public function get isMaximised():Boolean { return maximised; } EditController.toggleSize() { ... dispatchEvent(new Event("is_maximised")); } --- embedded/fullscreen-toggle.svg | 123 +++++++++++++++++++++++ embedded/fullscreen.svg | 123 +++++++++++++++++++++++ net/systemeD/potlatch2/EditController.as | 2 +- potlatch2.mxml | 3 + 4 files changed, 250 insertions(+), 1 deletion(-) create mode 100644 embedded/fullscreen-toggle.svg create mode 100644 embedded/fullscreen.svg diff --git a/embedded/fullscreen-toggle.svg b/embedded/fullscreen-toggle.svg new file mode 100644 index 00000000..0ba6a88e --- /dev/null +++ b/embedded/fullscreen-toggle.svg @@ -0,0 +1,123 @@ + + + +image/svg+xml + + + + + + + + + + + + + + \ No newline at end of file diff --git a/embedded/fullscreen.svg b/embedded/fullscreen.svg new file mode 100644 index 00000000..0c5074e4 --- /dev/null +++ b/embedded/fullscreen.svg @@ -0,0 +1,123 @@ + + + +image/svg+xml + + + + + + + + + + + + + + \ No newline at end of file diff --git a/net/systemeD/potlatch2/EditController.as b/net/systemeD/potlatch2/EditController.as index f70cc217..e6ce2bd5 100644 --- a/net/systemeD/potlatch2/EditController.as +++ b/net/systemeD/potlatch2/EditController.as @@ -201,7 +201,7 @@ package net.systemeD.potlatch2 { Mouse.registerCursor(name, cursorData); } - private function toggleSize():void { + public function toggleSize():void { if (maximised) { if (minimiseFunction) { ExternalInterface.call(minimiseFunction); diff --git a/potlatch2.mxml b/potlatch2.mxml index 2c51c570..326587f8 100644 --- a/potlatch2.mxml +++ b/potlatch2.mxml @@ -37,6 +37,9 @@ click="SaveManager.saveChanges(theMap.editableLayer.connection);" id="saveButton" enabled="false"/> +