Giter Site home page Giter Site logo

hellosystem / qtplugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mirrorstudio-devteam/panda-qt5-plugin

5.0 2.0 4.0 313 KB

Qt platform plugin and style, required for Qt applications to export their menus over D-Bus in the required format

CMake 3.60% C++ 96.21% C 0.19%
hellosystem qt desktop qss

qtplugin's Introduction

QtPlugin Build Status

Qt platform plugin and style. Exports windows to KDE-style global menus via D-Bus.

Dependencies

On Alpine Linux:

apk add qt5-qtbase-dev libqtxdg-dev extra-cmake-modules libdbusmenu-qt-dev xcb-util-wm-dev cmake musl-dev alpine-sdk clang

On Arch Linux:

sudo pacman -S gcc extra-cmake-modules qt5-base qt5-tools qt5-x11extras libqtxdg libdbusmenu-qt5 libxcb

On FreeBSD:

sudo pkg install -y curl zip cmake pkgconf libfm qt5-core qt5-x11extras qt5-widgets qt5-qmake qt5-buildtools qt5-linguisttools kf5-extra-cmake-modules libqtxdg libxcb libdbusmenu-qt5 kf5-kwindowsystem

Build

mkdir build
cd build
cmake ..
make
sudo make install

Usage

export QT_QPA_PLATFORMTHEME=panda
export QT_STYLE_OVERRIDE=fusion # Optional if you want another Qt style, e.g., the Qt default one
(start Qt applciation)

License

panda-qt5-plugins is licensed under GPLv3.

qtplugin's People

Contributors

jsm222 avatar probonopd avatar reionwong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

qtplugin's Issues

Do not hardcode the font size for buttons

To allow for, e.g.,

image

Also, the "About This Computer" screen has a button with smaller text, which is currently ignored for the same reason.

Also, we should set the fixed height for buttons only if the default font size is not changed; once that size is changed, we should not fix the button height anymore.

Reference:

Get rid of extra line around non-selected list item

Qt seems to draw a line around "the non-selected list item that would be selected if an item was selected" (I have no better way of puting this).

image

Does anyone know what this Qt UI element is called?
How can we get rid of it?

Causes Falkon rendering issues

Causes Falkon rendering issues on the second window opened, and on subsequent windows

image

This does not happen with the Qt default theme for Unix.

To reproduce:

killall falkon
unset QT_QPA_PLATFORMTHEME
falkon

Metrics are wrong on Linux

On Debian Sid with Qt version 5.15.2, text is not vertically centered.

image

Menu items have too large height.
Unlike on FreeBSD, using the exact same fonts.

Why the difference?

image

This is not caused by /etc/xdg/stylesheet.qss because the effect is there even without it.
The Qt Unix default theme does not have this issue.

Make button selected via keyboard visible by changing its outline color

Follow-up to #10.

Now that we do not display PE_FrameFocusRect anymore, we have no way of seeing when a button has the focus by pressing the tab key.

What we would like is the button border to get a different color when it has the focus, just like with drop-down menus and with QLineEdit.

ksnip_20210427-092043

Good:

    case PE_FrameLineEdit: {
        QRect r = option->rect;
        bool hasFocus = option->state & State_HasFocus;
        bool isEnabled = option->state & State_Enabled;
        const qreal rounding = Ph::LineEdit_Rounding;
        auto pen = hasFocus ? S_highlight_outline : S_window_outline;

The problem is that no case PE_PushButton exists. Why?

Do not show icons in menus except if specifically requested

In QtPlugin:

    QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
    QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus, true); // probono: need to use myAction->setIconVisibleInMenu(true); for menu items that shall get the icon nevertheless

In Menu:

                        action->setIcon(QIcon(IconCand));
                        action->setIconVisibleInMenu(true); // So that an icon is shown even though the theme sets Qt::AA_DontShowIconsInMenus

Give the window a thin border

image
Let the window have thin borders so that the screen will not stick to other windows when there is no shadow effect.

Add accessibility features

Make the handicapped have a good experience.
image
(If it is difficult to implement, start with invert color)

Enable MacKeyboardScheme, make QKeySequence::StandardKey behave like on the Mac

Currently we have the clearly Windows-inspired "F3" for Find Again, whereas we want Command-G.

Supposedly we can get this for all Qt applications by setting QPlatformTheme::MacKeyboardScheme. How?

Command-G is mentioned in the early Macintosh Human Interface Guidelines:

image

Source: Apple Computer, Inc. 1992. Macintosh human interface guidelines. Addison-Wesley Publishing Company, USA. https://dl.acm.org/doi/book/10.5555/573097

Make Qt behave more like on the Mac

  • Make Wizards use MacStyle by default
  • Flash/blink selected menu items (would be nice if we could let them blink more than once)
  • Do not fade out menus after something has been selected (unsure on this one)
    case SH_WizardStyle:
        return QWizard::MacStyle; // probono
    case SH_Menu_FlashTriggeredItem:
        return 1; // probono
    case SH_Menu_FadeOutOnHide:
        return 0;  // probono

Port to Qt6

In order to get Qt6 applications (e.g., Qt Creator in 2024Q1 packages) to use our theme and work correctly, we need to build a version of QtPlugin for Qt6.

Issues:

Darken window background color

The color of the window is still too bright and it will still be uncomfortable if you look at it for a long time. I wish it could be darker.
273449876-09af3a00-6032-4bad-a6d4-b6079d3ec3b4
maxresdefault - 2023-10-14T111301 160

[CMake] Get it to build for Qt6, too

Get it to build for Qt6, too.

My attempts in af0157e ++ so far were not successful -- looks like doing this in CMake in a way that works on both FreeBSD and Ubuntu is way more complicated than it should be...

Shrink PanelButtonTool

Shrink these things and make them less ugly:

image

How can it be done? I think it has to do with PE_PanelButtonTool somehow?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.