wiln / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

[SuperTabNavigator] patch for resizable close button, optional 'close all tabs' button in tabBar #348

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A patch (output of svn diff) to have two additional features:

(1) Resizable close button.

The old navigator has size hardcoded on 10 (pixels) those properties now are 
customizable.

It can be customized by using the patched flexlib and subclassing the 
SuperTabBar:

public class CustomSuperTabBar extends SuperTabBar {
    public function CustomSuperTabBar() {
        super();

        defaultTabProperties =  
            { 
            "closeButtonHeight": 17, 
            "closeButtonWidth": 17
            };
    }
}

(2) Add a 'close all tabs' button in navigation bar (just left from popup 
button)

public class CustomSuperTabNavigator extends SuperTabNavigator {
    public function CustomSuperTabNavigator() {
        super();
        // close all button is visible by default. If  this is not desired, add:
        // closeAllButtonEnabled = false;
    }

    override protected function createChildren():void {
        super.createChildren();
        closeAllButton.addEventListener(MouseEvent.CLICK,closeAllTabsHandler);
    }

    private function closeAllTabsHandler(event:MouseEvent):void {   
        // see SuperTabBar.onCloseTabClicked() how to close tabs...
        // you probably want to have a confirmation dialog before closing all.
    }
} 

Attached is the output of svn diff compared to trunk. Info and how it was 
generated:
C:\flexlib>svn info
Path: .
URL: http://flexlib.googlecode.com/svn/trunk
Repository Root: http://flexlib.googlecode.com/svn
Repository UUID: d9d5f27d-7529-0410-ab0a-a9f3ddeb9b35
Revision: 244
Node Kind: directory
Schedule: normal
Last Changed Author: wasbridge
Last Changed Rev: 244
Last Changed Date: 2011-02-08 09:35:36 +0100 (Tue, 08 Feb 2011)

svn diff > 
flexlib-svn-diff-close-button-dimensions-customizable-and-close-all-button.patch

Could this patch be merged into the trunk? If I get svn write access I'm 
willing to do this myself.

Thanks,

Kees

Original issue reported on code.google.com by keesvand...@gmail.com on 21 Feb 2011 at 8:24

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Can you please submit this changes for git-version?

Original comment by pir...@gmail.com on 30 Jan 2012 at 2:30

GoogleCodeExporter commented 8 years ago
Currently I am not able to do so. 

We currently have no Flex 4 IDE / license (Only Flex 3) and Flexlib on github 
is flex 4 only. So this won't be easy to do for me.

Original comment by keesvand...@gmail.com on 29 Feb 2012 at 8:16