Revivius / nb-darcula

Darcula LAF for NetBeans
277 stars 83 forks source link

Replace dotted header icons #34

Closed markiewb closed 8 years ago

markiewb commented 8 years ago

2016-01-25_21h03_24

See also the latest screenshots from @ZMichaelChow at https://github.com/Revivius/nb-darcula/issues/20 He compared several other LAFs and also the Darcula LAF from IDEA

Revivius commented 8 years ago

@markiewb, @ZMichaelChow let me try.

markiewb commented 8 years ago

That would be cool! Thanks!

Revivius commented 8 years ago

Well; after some digging in NetBeans sources I can see that a hardcoded color is used:

package org.netbeans.swing.tabcontrol.plaf;

abstract class AbstractWinViewTabDisplayerUI {
    @Override
    protected void paintTabContent(Graphics g, int index, String text, int x,
                                   int y, int width, int height) {
        ...
        if( isUseStretchingTabs() ) {
            ColorUtil.paintVistaTabDragTexture(getDisplayer(), g, x + BUMP_X_PAD, y
                     + BUMP_Y_PAD_UPPER, height - (BUMP_Y_PAD_UPPER
                     + BUMP_Y_PAD_BOTTOM));
        }
        ...
    }
}

final class ColorUtil {
    ...
    /**
     * Draws drag texture of the tab in specified bounds.
     */
    public static void paintVistaTabDragTexture(Component control, Graphics g,
                                             int x, int y, int height) {
        if (VISTA_DRAG_IMAGE == null) {
            VISTA_DRAG_IMAGE = initVistaDragTextureImage();
        }
        int count = height / 4;
        int ypos = y;
606:    g.setColor( Color.WHITE ); // <<<<<--- How to hack this ?
        for (int i = 0; i < count; i++) {
            VISTA_DRAG_IMAGE.paintIcon(control, g, x, ypos);
            g.drawLine( x+1, ypos+2, x+2, ypos+2 );
            g.drawLine( x+2, ypos+1, x+2, ypos+1 );
            ypos += 4;
        }
    }
    ...
}

So if we keep using stretched tabs I dont see a way of changing the hardcoded white color in ColorUtil:606. But If we drop using stretched tabs (which is default since NB 8.0 I think) dotted icon not painted:

non_stretched_tabs

Personally I think stretched tabs are better and current icon is not that bad. What say you ?

markiewb commented 8 years ago

IMO the non-streched variant looks OK for me.

Provide an option and let the user decide. It would be a waste of your invested free-time, if there is no output.

Saljack commented 8 years ago

Non-streched variant is better for me because there are not minimaze button on tab. I have problem with order of close, minimaze buttons. I think order minimaze before close makes more sense minimazebutton

minimazebutton .

mizhoux commented 8 years ago

Non-streched tabs is better for me, too. I always make the tabs non-streched :) I agree with @markiewb. If possible(and convenient), provide an option in "Tools->Options" and let the user decide.

Revivius commented 8 years ago

OK! now user can opt to use stretched tabs or not. Tabs are not stretched by default:

stretched_tabs

Thanks everybody for opinions.

markiewb commented 8 years ago

Thank you too!

mizhoux commented 8 years ago

Well done! Thank you so much~