Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Menubar class #158

Closed
hrw opened this issue Jan 6, 2020 · 11 comments
Closed

Create Menubar class #158

hrw opened this issue Jan 6, 2020 · 11 comments

Comments

@hrw
Copy link

hrw commented Jan 6, 2020

The only way to create something resembling menu in libyui is using YMenuButtons. It looks good on ncurses frontend but terribly on Gtk/Qt one.

Have you considered creating YMenuBar class? To use GtkMenuBar/QMenuBar and draw a line of YMenuButtons for ncurses backend.

Would make app look more like other Gtk/Qt apps.

@ancorgs
Copy link

ancorgs commented Jan 31, 2020

It's not pure libYUI, but YaST has some menus configured here:
https://github.com/yast/yast-autoinstallation/blob/master/src/include/autoinstall/conftree.rb#L374

Result:
menu

@anaselli
Copy link
Contributor

anaselli commented Apr 18, 2020

I would like to propose a minimal, aesthetic change. That has no impacts on libyui implementation, just on Qt and Gtk plugins. See picture below (Qt one is the first):

dnfdragora Qt Menu

dnfdragora Gtk Menu

The change just removes the border to menu buttons. I think that could be a good compromise, what do you think about it?
I will provide PR later eventually.

@Conan-Kudo
Copy link

It's an improvement, though I wonder why libyui can't provide a proper menubar class? Is it because of ncurses?

@papoteur-mga
Copy link

Yes, Angelo, this is a better look, buttons doesn't more look as separated.

@anaselli
Copy link
Contributor

It's an improvement, though I wonder why libyui can't provide a proper menubar class? Is it because of ncurses?

well YMenuButton is the libyui abstraction. So it's provided something for menus, plugins should implement it better at least for GUI, while TUI can be acceptable.
BTW if you have an idea how it can be provided i can add it to MGA Plugin first...

@Conan-Kudo
Copy link

Perhaps in the MGA plugin, we have a YMGAMenuBar class that uses the native QMenuBar (Qt) and GtkMenuBar (Gtk3). For ncurses, this could be implemented using the menus library in ncurses.

@anaselli
Copy link
Contributor

anaselli commented May 11, 2020

FWIW I'm working on it into MGA plugin Gtk, Qt and of course ncurses. Not finished yet but in progress :)

@shundhammer
Copy link
Contributor

shundhammer commented Jun 23, 2020

There is minimalistic support for menu bars in the wizard widget, but that is an optional one and not available for NCurses.

We are planning to add a real menu bar soon; even though this is strictly speaking against the philosophy of libyui: A simplified widget toolkit for simple system administration tasks that are typically wizard-driven. Anything as complex requiring many different actions in the same window that it would need a menu bar is actually beyond that scope; that's a document-centric user interface rather than the wizard-driven workflows that we usually have.

Having said that, there are still fringe cases where those philosophies overlap. But please understand that there will probably still be limitations, partly being limited by what can reasonably be done by a text-based interface like libyui-ncurses and the level of fine-control (or rather the lack of it) that a very abstract API like libyui offers.

@anaselli
Copy link
Contributor

anaselli commented Jun 23, 2020

I see, if you're interested in see what we've done already into mga plugin have a look at the WIP TODO and of course if you've time to do it, also testing it :)

@lslezak
Copy link
Member

lslezak commented Aug 17, 2020

It has been added recently to the libyui, see these pulls:

So let's close this one. 😃

@lslezak lslezak closed this as completed Aug 17, 2020
@anaselli
Copy link
Contributor

Let's recall this issue here

The only way to create something resembling menu in libyui is using YMenuButtons. It looks good on ncurses frontend but terribly on Gtk/Qt one.

terribly on Gtk/Qt one

Have you considered creating YMenuBar class? To use GtkMenuBar/QMenuBar and draw a line of YMenuButtons for ncurses backend.

Would make app look more like other Gtk/Qt apps.

Would make app look more like other Gtk/Qt apps

I'm not sure this issue has been really fixed (well it is using mga plugin really), the request was to have a menubar working for Gtk and Qt apps, here i seem to read that has been developed for Qt and ncurses.

Anyway I'll take my time to test the implementation and add my comments on other related issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants