Hi,
Most of the time, when using Geany, I don't need the menu and status bars; they are just noise. But occasionally I want to check the status bar (e.g. for the line/column number) or browse the menu. So I want to toggle their visibility with a keystroke.
I wrote a simple plugin for that: https://github.com/vfaronov/geany-togglebars
The problem is, the menu and status bars are not exposed in geany.main_widgets, so I have to find them manually, which makes the plugin brittle as it relies on a specific window layout.
Perhaps there is a better way to do it?
Perhaps the menu and status bars should be exposed in main_widgets?
Or perhaps this feature should be in Geany core? We already have keybindings for the sidebar and the messages pane. There is some discussion in issue #633, but I'm not sure what to make of it.
On 2 July 2016 at 19:08, Vasiliy Faronov vfaronov@gmail.com wrote:
Hi,
Most of the time, when using Geany, I don't need the menu and status bars; they are just noise. But occasionally I want to check the status bar (e.g. for the line/column number) or browse the menu. So I want to toggle their visibility with a keystroke.
I wrote a simple plugin for that: https://github.com/vfaronov/geany-togglebars
The problem is, the menu and status bars are not exposed in geany.main_widgets, so I have to find them manually, which makes the plugin brittle as it relies on a specific window layout.
Unfortunately yes.
Perhaps there is a better way to do it?
Perhaps the menu and status bars should be exposed in main_widgets?
Well, you can make a pull request and see what happens.
Or perhaps this feature should be in Geany core? We already have keybindings for the sidebar and the messages pane. There is some discussion in issue #633, but I'm not sure what to make of it.
It got a bit side-tracked, but basically the opinion of several Geany devs is that hiding the menu is a bad idea. It has been discussed in other places as well, but I can't find it ATM.
In general your plugin is probably the best, though a way of hiding the menu that was not in the menu and unbound by default might be accepted.
Cheers Lex
-- Vasiliy _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Le 02/07/2016 à 11:08, Vasiliy Faronov a écrit :
Hi,
Most of the time, when using Geany, I don't need the menu and status bars; they are just noise. But occasionally I want to check the status bar (e.g. for the line/column number) or browse the menu. So I want to toggle their visibility with a keystroke.
I wrote a simple plugin for that: https://github.com/vfaronov/geany-togglebars
The problem is, the menu and status bars are not exposed in geany.main_widgets, so I have to find them manually, which makes the plugin brittle as it relies on a specific window layout.
Perhaps there is a better way to do it?
You could use a more solid resolve_widget() function, that doesn't rely on the layout, something like that:
def resolve_widget(widget, expected_type): if isinstance(widget, expected_type): return widget elif isinstance(widget, Gtk.Container): for child in widget.get_children(): ret = resolve_widget(child, expected_type) if ret: return ret return None
Also, your plugin is a bit dangerous for the new user if I read it correctly: you do not bind the keybinding by default (which is good), but you hide the menubar by default. This means that the user enabling your plugin might be totally lost with no way of recovering his/her menubar to even access the preferences and set a keybinding.
I guess you did that because you didn't wanna bother about a configuration file for saving the state for such a little thing you probably didn't mean to publish so much, but if you do want to publish it it'd be important to resolve this.
Regards, Colomban
I've wondered about this feature myself. My temporary solution was to write a plugin that hides the menu bar until mouse over, like the Start bar used to be configurable in Windows. I haven't had a chance to update all of my plugins to the latest geany, but if you care to look at the plugin, you can see it here https://github.com/sblatnick/geany-plugins/blob/master/hide-menu/src/hide-menu.c.
Alternatively, I thought the best idea would be a single icon, like chrome's menu icon. The problem is finding a place for it that doesn't occupy an entire row or column of screen space.
Thanks,
Steve
On 07/04/2016 10:23 AM, Colomban Wendling wrote:
Le 02/07/2016 à 11:08, Vasiliy Faronov a écrit :
Hi,
Most of the time, when using Geany, I don't need the menu and status bars; they are just noise. But occasionally I want to check the status bar (e.g. for the line/column number) or browse the menu. So I want to toggle their visibility with a keystroke.
I wrote a simple plugin for that: https://github.com/vfaronov/geany-togglebars
The problem is, the menu and status bars are not exposed in geany.main_widgets, so I have to find them manually, which makes the plugin brittle as it relies on a specific window layout.
Perhaps there is a better way to do it?
You could use a more solid resolve_widget() function, that doesn't rely on the layout, something like that:
def resolve_widget(widget, expected_type): if isinstance(widget, expected_type): return widget elif isinstance(widget, Gtk.Container): for child in widget.get_children(): ret = resolve_widget(child, expected_type) if ret: return ret return None
Also, your plugin is a bit dangerous for the new user if I read it correctly: you do not bind the keybinding by default (which is good), but you hide the menubar by default. This means that the user enabling your plugin might be totally lost with no way of recovering his/her menubar to even access the preferences and set a keybinding.
I guess you did that because you didn't wanna bother about a configuration file for saving the state for such a little thing you probably didn't mean to publish so much, but if you do want to publish it it'd be important to resolve this.
Regards, Colomban _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 2016-07-05 08:31 AM, Steven Blatnick wrote:
I've wondered about this feature myself. My temporary solution was to write a plugin that hides the menu bar until mouse over, like the Start bar used to be configurable in Windows. I haven't had a chance to update all of my plugins to the latest geany, but if you care to look at the plugin, you can see it here https://github.com/sblatnick/geany-plugins/blob/master/hide-menu/src/hide-menu.c.
Alternatively, I thought the best idea would be a single icon, like chrome's menu icon. The problem is finding a place for it that doesn't occupy an entire row or column of screen space.
When I implemented this in Mousepad, I just had it add a menu item to the right-click menu to allow turning it back on whenever the menu bar was hidden. The auto hide/show seems also like a good idea.
Cheers, Matthew Brush
Yeah, the autohide until mouse-over is a simple solution, but it is kinda jumpy whenever I go to my MATE system tray and cross over the menu area. I could make it wait longer before opening, but then that would feel clunky. Right now, it expands for a few seconds until a menu is clicked, then keeps it open until the menu has been exited. The other problem is the toolbar which I put inline with the menus doesn't stay visible long enough to use.
We should put in core geany or a plugin the ability to move the menu to the toolbar in a single icon like Chrome, instead or in addition to the existing functionality to move the toolbar to the menubar. However, that solution doesn't reduce the valuable vertical real estate. Darn wide screens nowadays ;-)
Thanks,
Steve
On 07/05/2016 05:51 PM, Matthew Brush wrote:
On 2016-07-05 08:31 AM, Steven Blatnick wrote:
I've wondered about this feature myself. My temporary solution was to write a plugin that hides the menu bar until mouse over, like the Start bar used to be configurable in Windows. I haven't had a chance to update all of my plugins to the latest geany, but if you care to look at the plugin, you can see it here https://github.com/sblatnick/geany-plugins/blob/master/hide-menu/src/hide-menu.c.
Alternatively, I thought the best idea would be a single icon, like chrome's menu icon. The problem is finding a place for it that doesn't occupy an entire row or column of screen space.
When I implemented this in Mousepad, I just had it add a menu item to the right-click menu to allow turning it back on whenever the menu bar was hidden. The auto hide/show seems also like a good idea.
Cheers, Matthew Brush _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 2016-07-06 09:23 AM, Steven Blatnick wrote:
[...] We should put in core geany or a plugin the ability to move the menu to the toolbar in a single icon like Chrome, instead or in addition to the existing functionality to move the toolbar to the menubar. [...]
NO HAMBURGERS!
Regards, Matthew Brush
What does hamburger mean in this context?
On 07/06/2016 05:54 PM, Matthew Brush wrote:
On 2016-07-06 09:23 AM, Steven Blatnick wrote:
[...] We should put in core geany or a plugin the ability to move the menu to the toolbar in a single icon like Chrome, instead or in addition to the existing functionality to move the toolbar to the menubar. [...]
NO HAMBURGERS!
Regards, Matthew Brush _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 2016-07-06 05:10 PM, Steven Blatnick wrote:
What does hamburger mean in this context?
https://en.wikipedia.org/wiki/Hamburger_button
Cheers, Matthew Brush
On 07/06/2016 05:54 PM, Matthew Brush wrote:
On 2016-07-06 09:23 AM, Steven Blatnick wrote:
[...] We should put in core geany or a plugin the ability to move the menu to the toolbar in a single icon like Chrome, instead or in addition to the existing functionality to move the toolbar to the menubar. [...]
NO HAMBURGERS!
Regards, Matthew Brush _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Ok a skinny burger (as used in chrome, three dots not three bars :)
Cheers Lex
On 7 July 2016 at 10:14, Matthew Brush mbrush@codebrainz.ca wrote:
On 2016-07-06 05:10 PM, Steven Blatnick wrote:
What does hamburger mean in this context?
https://en.wikipedia.org/wiki/Hamburger_button
Cheers, Matthew Brush
On 07/06/2016 05:54 PM, Matthew Brush wrote:
On 2016-07-06 09:23 AM, Steven Blatnick wrote:
[...] We should put in core geany or a plugin the ability to move the menu to the toolbar in a single icon like Chrome, instead or in addition to the existing functionality to move the toolbar to the menubar. [...]
NO HAMBURGERS!
Regards, Matthew Brush _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
We could add the hamburger button to the toolbar so it could hide the menu.
On 7 July 2016 at 10:29, Lex Trotman elextr@gmail.com wrote:
Ok a skinny burger (as used in chrome, three dots not three bars :)
Cheers Lex
On 7 July 2016 at 10:14, Matthew Brush mbrush@codebrainz.ca wrote:
On 2016-07-06 05:10 PM, Steven Blatnick wrote:
What does hamburger mean in this context?
https://en.wikipedia.org/wiki/Hamburger_button
Cheers, Matthew Brush
On 07/06/2016 05:54 PM, Matthew Brush wrote:
On 2016-07-06 09:23 AM, Steven Blatnick wrote:
[...] We should put in core geany or a plugin the ability to move the menu to the toolbar in a single icon like Chrome, instead or in addition to the existing functionality to move the toolbar to the menubar. [...]
NO HAMBURGERS!
Regards, Matthew Brush _______________________________________________ Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 2016-07-06 05:37 PM, Lex Trotman wrote:
We could add the hamburger button to the toolbar so it could hide the menu.
Not everyone has the toolbar visible. And it'd have to be visible in the default toolbar layout (-1) or else people who do have it visible wouldn't realize they had to customize the toolbar in order to get their menu back. Additionally, anyone who has already customized their toolbar would have to somehow get their toolbar.xml file overridden by the default one. Otherwise, we'd have to add special code to add it unconditionally to the toolbar when the menu is hidden, which would require special casing to ensure it's not overflowed off of the toolbar and such. Of course then people would want preferences to disable that behaviour, etc.
IMO, adding a "Show Menu" item to the right-click menus is a simple and effective way to restore a lost menu bar.
P.S. Personally I have no reason to hide the main menu, I just put the message window on the right to use all that wasted screen-estate, leaving ample vertical space for the menu/toolbar/code.
Cheers, Matthew Brush