Reserve width for esential actions

Hi,

I have an ergonomic issue:

When their no enough space for the „framework actions“, actions such as „maximize, minimize, externalize, close, etc…“ the actions are put in a hidden menu and accessed from an arrow icon.

Is it feasible to reserve a default static width for essential icons, [I mean by essential : minimize, maximize, externalize and close]
and in case we want to display more that the essential icons, they will be shown in a menu, when no place is available

IMHO, I found this issue very user friendly :slight_smile:

Thank you

I’ll put it on the todo list, it should not be too hard to implement this feature. I may not include it in 1.1.0 tough.

Thank you

Hi Beni,

I am interested in this issue too. It would be good to have a way to keep the actions such as “maximize”, “minimize”, “externalize” always appearing on the dockable, and never move them to a menu.

Was there any development done in this regard? Is this already available in the latest version?

Thanks

This feature has been implemented, but it is not yet online. Manly because I implemented it in the last hour just so I can say “of course, I never forget something that is on the todo list”.

The feature will be available with 1.1.1p6b, although I do not yet know when 1.1.1p6b will be ready. Probably in one or two weeks. In any case it is already pushed into the master branch of the Git repository.

With the next version you will have the possibility to mark any action with a “DockActionImportance” to tell how important it is. Or you implement the “DockActionImportanceOrder” interface and write a custom algorithm for ordering actions.

A test client will look like this.


import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;

import javax.swing.Icon;
import javax.swing.JFrame;

import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
import bibliothek.gui.dock.common.action.CButton;
import bibliothek.gui.dock.common.theme.ThemeMap;
import bibliothek.gui.dock.themes.basic.action.DockActionImportance;

public class Dock05 {
	public static void main( String[] args ){
		JFrame frame = new JFrame("Test");
		frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
		frame.setBounds( 20, 20, 400, 400 );
		
		CControl control = new CControl( frame );
		control.setTheme( ThemeMap.KEY_ECLIPSE_THEME );
		
		frame.add( control.getContentArea() );
		
		DefaultSingleCDockable dockable = new DefaultSingleCDockable( "test", "Hallo" );
		DefaultSingleCDockable dockable1 = new DefaultSingleCDockable( "test1", "Hallo" );
		DefaultSingleCDockable dockable2 = new DefaultSingleCDockable( "test2", "Hallo" );
		
		dockable.addAction( new ReallyUnimportant() );
		dockable.addAction( new NotImportant() );
		dockable.addAction( new Important() );
		dockable.addAction( new VeryImportant() );
		dockable.addAction( new VeryImportant() );
		dockable.addAction( new Important() );
		dockable.addAction( new NotImportant() );
		dockable.addAction( new ReallyUnimportant() );
		
		control.addDockable( dockable );
		control.addDockable( dockable1 );
		control.addDockable( dockable2 );
		dockable.setVisible( true );
		dockable1.setVisible( true );
		dockable2.setVisible( true );
		
		frame.setVisible( true );
	}
	
	public static class ImportantIcon implements Icon{
		private Color color;
		
		public ImportantIcon( Color color ){
			this.color = color;
		}
		
		public int getIconHeight(){
			return 16;
		}
		
		public int getIconWidth(){
			return 16;
		}
		
		public void paintIcon( Component c, Graphics g, int x, int y ){
			g.setColor( color );
			g.fillOval( x, y, 16, 16 );
		}
	}
	
	@DockActionImportance(5.0)
	private static class VeryImportant extends CButton{
		public VeryImportant(){
			setIcon( new ImportantIcon( Color.RED ) );
		}
		
		@Override
		protected void action(){
			System.out.println( getClass().getSimpleName() );
		}
	}
	
	@DockActionImportance(3.0)
	private static class Important extends CButton{
		public Important(){
			setIcon( new ImportantIcon( Color.ORANGE ) );
		}
		
		@Override
		protected void action(){
			System.out.println( getClass().getSimpleName() );
		}
	}
	
	@DockActionImportance(0.0)
	private static class NotImportant extends CButton{
		public NotImportant(){
			setIcon( new ImportantIcon( Color.YELLOW ) );
		}
		
		@Override
		protected void action(){
			System.out.println( getClass().getSimpleName() );
		}
	}
	
	@DockActionImportance(-5.0)
	private static class ReallyUnimportant extends CButton{
		public ReallyUnimportant(){
			setIcon( new ImportantIcon( Color.WHITE ) );
		}
		
		@Override
		protected void action(){
			System.out.println( getClass().getSimpleName() );
		}
	}
}

Thank you Beni!

So if I don’t want to wait one or two weeks, is it safe to get the latest code from the Git repository? And do I have permission to do that?

Thanks

[QUOTE=Unregistered]Thank you Beni!

So if I don’t want to wait one or two weeks, is it safe to get the latest code from the Git repository? And do I have permission to do that?

Thanks[/QUOTE]

Anybody has read permission. The contents in the repository are most times ready, I follow the policy that every commit should be ready for publishing.