Re: Potential GNOME IDE



On Mon, 2014-01-06 at 10:02 +0000, Michael Ikey Doherty wrote:
On Mon, 2014-01-06 at 10:49 +0100, Geertjan Wielenga wrote:

Anything that can be done to get things closer to where we want them to 
be is worth doing, imho. Also an issue somewhere listing all these 
different problems would really help as a centralized way of figuring 
out how to solve them.

Gj
That's great to hear. From what I can see, the icon issue is partly
resolvable already. It used to be possible to use sun.awt.UNIXToolkit to
obtain stock icons from GTK, and this used to be the entry point for
native GTK library loading (via loadGTK()).

Are you aware whether UNIXToolkit is still employed? If so, I can look
into it and attempt a migration from GTK2 to GTK3. The stock icon method
could be replaced (as its now deprecated) with a mechanism for obtaining
via a freedesktop icon name, which would then permit access to the
native icons, further improving integration.

Perhaps a wrapper could be created for JMenu to use a specialised window
container as its toplevel, ensuring menus appear "native" on Linux/GTK?

- Ikey
Ok, icons and menus are indeed fixable (JDK7/8 tested)
Screenshot:
https://plus.google.com/107691710289083956125/posts/3kqDuDLxjsp

Code snippet should help demonstrate (using getStockIcon and ensuring
lightweight menus are disabled). Note with GTK3 support we'd want to
kill stock and support icon names only from the word go. (Named icons
look far better, integrate better, and there are a whole bunch more
icons)

import javax.swing.*;
import java.awt.Toolkit;
import java.awt.FlowLayout;
import java.awt.image.BufferedImage;
import sun.awt.UNIXToolkit;

import static com.sun.java.swing.plaf.gtk.GTKConstants.*;


public final class Test extends JFrame {

    private UNIXToolkit toolkit = null;

    protected BufferedImage getStockIcon(String name, boolean large) {
        if (toolkit == null) {
            Toolkit t = Toolkit.getDefaultToolkit();
            if (t instanceof UNIXToolkit) {
                toolkit = (UNIXToolkit)t;
            }
        }
        IconSize size = large? IconSize.BUTTON : IconSize.MENU;
        BufferedImage im = toolkit.getStockIcon(1, name,
size.ordinal() , 1, null);
        return im;
    }

    public Test() {
        BufferedImage im;
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(400, 400);
        setVisible(true);
        setTitle("Testing");
        JButton b = new JButton("About");
        this.setLayout(new FlowLayout());
        ImageIcon ico = null;
        this.add(b);
        ico = new ImageIcon(getStockIcon("gtk-about", true));
        b.setIcon(ico);

        // Create menu
        JMenuBar mbar = new JMenuBar();
        JMenu menu = new JMenu("File");
        JMenuItem quit = new JMenuItem("Quit");
        menu.add(quit);
        ico = new ImageIcon(getStockIcon("gtk-close", false));
        quit.setIcon(ico);
        mbar.add(menu);
        setJMenuBar(mbar);
    }

    public static void main(String[] args) {
        try {

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception ex) { }
        JPopupMenu.setDefaultLightWeightPopupEnabled(false);

        Test t = new Test();
    }
}

Kind Regards,
Ikey Doherty



On 01/06/2014 10:45 AM, Michael Ikey Doherty wrote:
On Mon, 2014-01-06 at 10:37 +0100, Geertjan Wielenga wrote:
On 01/06/2014 10:31 AM, Michael Ikey Doherty wrote:
On Mon, 2014-01-06 at 10:23 +0100, Geertjan Wielenga wrote:
Looking at the screenshots it looks more like a JDK or Gnome bug. There
are no layout or painting issues in the screenshot, just the window
decorations are missing. We need IDE log to see what’s wrong.

Gj
It isn't an IDE bug, its a very long standing Java issue (harks back to
1.4.2 days. Suffered for years). Swing's GTK "integration" has been
sub-par since its very beginnings. Priority is given to Windows
integration and GTK just does not look good. Whilst it may appear there
are no layout issues in the screenshots, they do not conform to the rest
of the GNOME applications, which obviously determine their padding and
{x,y} offsets from the relevant theme files.

I've raised the issue many times over the last few years to no avail,
Issue number, please.
If I could still find it I would, I gave up when the infrastructure kept
changing a few years back and I was unable to log in to any systems
anymore.

I'm happy to look at patching the existing GTK theme implementation to
be slightly more accurate, however that still leaves minor issues that
build up into something that has been deemed "ugly" (read: non-native
looking) within this list. Certain things like the fact a menu (popdown
or popup) has no composited shadow under Linux because it uses an
undecorated window as opposed to a window with the popup class. These
are things that would have to be changed at a toolkit level.

Given the way that Swing works, in an abstract manner with pluggable
look and feels, it would seem the goal of integration is impossible.
Compound that with the fact themes are pulled from deprecated GTK2 rc
files, there is no native widget support, and freedesktop icon themes
are unsupported, is GTK integration for Netbeans even a likely goal?

- Ikey
Thanks,

Geertjan


even whilst Sun developed Java. Unfortunately it seems even Swing itself
now is considered legacy in the face of JavaFX, so perhaps the GTK
"integration" will never truly be realized.

- Ikey
On 01/06/2014 09:28 AM, Michael Ikey Doherty wrote:
On Mon, 2014-01-06 at 08:54 +0100, Geertjan Wielenga wrote:
Can someone send a screenshot showing how NetBeans is not so well
integrated? Then we can create an issue in the NetBeans bugtracker and
get it fixed.

Thanks,

Gj
Please see my G+ album for two screenshots:
https://plus.google.com/+IkeyDoherty/posts/bs7UADZ2v7r

Swing popups are undecorated, no doubt due to the fact they're actually
undecorated windows, not using a popup class. Spacing and padding is off
on all menus and buttons (not wide enough). Icon tabs (not sure what
you're calling them in Netbeans) in the preferences dialog use the
Nimbus look and feel, as opposed to falling back to a GTK style button.

Spacing is off on menus, etc. Icons are Nimbus, not GTK (though this is
most likely just not going to be fixed, due to a lack of support for
native theme access (freedesktop icons))

Happy to report other issues if required. Problem is that the GTK theme
in Swing merely uses a GTK2 library to render pixmaps in Swings own way.
Native integration is always going to be an enormous obstacle with a
non-native approach (Which exists for obvious reasons, I know. Just
reporting :))

Kind Regards,
Ikey Doherty

On 01/06/2014 08:51 AM, Julien Olivier wrote:
Le lundi 06 janvier 2014 à 01:45 -0200, Fernando Cassia a écrit :
On Sun, Jan 5, 2014 at 7:55 PM, Mike <mikeandmore gmail com> wrote:
I guess that's why there are users perfer to use "ugly" IDE like netbeans
rather than a good looking Anjuta.
If everyone keeps repeating the "Netbeans is ugly" line, does it make
it true? Less complete than this hypothetical new IDE that is yet to
be written. ;)

I really think that by "it's ugly", all he meant was that it looked ugly
(and not so well integrated) compared to a native GTK3 app in a GNOME 3
environment. And this is *true*, even if not *important*.

_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list


---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/desktop-devel-list


---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]