This forum has been archived. All content is frozen. Please use KDE Discuss instead.

how to change the size of button in KDE Plasma 5

Tags: None
(comma "," separated)
harishpathangay
Registered Member
Posts
25
Karma
0
Hi,

how to change the size of button in KDE Plasma 5?
For Example, the Configure and Apply button in System settings.

Thanks,
Harish Pathangay
User avatar
google01103
Manager
Posts
6668
Karma
25
moved to Plasma 5 forum


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
Rog131
Registered Member
Posts
828
Karma
10
harishpathangay wrote:Hi,

how to change the size of button in KDE Plasma 5?
For Example, the Configure and Apply button in System settings.

Thanks,
Harish Pathangay


One way is to use the Qt Style Sheets: http://doc.qt.io/qt-5.7/stylesheet.html

Examples:
- http://doc.qt.io/qt-5.7/stylesheet-examples.html
- http://stackoverflow.com/questions/1938 ... ttons-size

System Settings buttons with yellow background, red text, max width 50 px, max height 10 px:

Starting the System Settings with:
Code: Select all
systemsettings5 -stylesheet /path/to/button.qss


button.qss:
Code: Select all
QPushButton {
    background-color: yellow;
    color: red;
    max-width: 50px;
    max-height: 10px;
}


=>

Image
jinshil
Registered Member
Posts
2
Karma
0
Clever!

A few questions

1. How did you know about this feature of 'systemsettings5'? The command 'systemsettings5 --help' displays no such mention of this feature.

2. How do you get these settings to persist? I tried it myself, and as soon as you close the System Settings window, the changes to the button are lost.
User avatar
Rog131
Registered Member
Posts
828
Karma
10
jinshil wrote:Clever!

A few questions

1. How did you know about this feature of 'systemsettings5'? The command 'systemsettings5 --help' displays no such mention of this feature.

2. How do you get these settings to persist? I tried it myself, and as soon as you close the System Settings window, the changes to the button are lost.



#1

- systemsettings5 is a KDE application but it is also a Qt application.
- earlier: https://www.kubuntuforums.net/showthrea ... post363390
- the KF5 applications are not showing as many help options as the KDE4 did:

Code: Select all
$ dolphin4 --help-all
Usage: dolphin4 [Qt-options] [KDE-options] [options] [Url]

File Manager

Generic options:
  --help                    Show help about options
  --help-qt                 Show Qt specific options
  --help-kde                Show KDE specific options
  --help-all                Show all options
...
Qt options:
...
  --stylesheet <file.qss>   applies the Qt stylesheet to the application widgets
...


Code: Select all
$ dolphin --help
Usage: dolphin [options] +[Url]
File Manager

Options:
  -v, --version              Displays version information.
  -h, --help                 Displays this help.
  --author                   Show author information.
  --license                  Show license information.
  --desktopfile <file name>  The base file name of the desktop entry for this
                             application.
  --select                   The files and directories passed as arguments will
                             be selected.
  --split                    Dolphin will get started with a split view.
  --daemon                   Start Dolphin Daemon (only required for DBus
                             Interface)

Arguments:
  +[Url]                     Document to open



#2

- by adding the option to the menu:

Image

- by editing the sources
jinshil
Registered Member
Posts
2
Karma
0
Thanks for that.

However, I think the original person (and myself) are looking for a way to change the size of the button globally using the System Settings, not changing the size of the button in the System Settings application only. Is there a way to use that stylesheet globally for all Qt applications?
User avatar
Rog131
Registered Member
Posts
828
Karma
10
jinshil wrote:Thanks for that.

However, I think the original person (and myself) are looking for a way to change the size of the button globally using the System Settings, not changing the size of the button in the System Settings application only. Is there a way to use that stylesheet globally for all Qt applications?


If the question is: Is there an option to edit the widget styles from the KDE System settings ?

By my knowledge the only option is KDE system settings > Application Style > Widget Style; Pick the widget style & configure - there are some configurable settings.

There are wishes:
- An easy way to apply Qstylesheets: viewtopic.php?f=90&t=88098
- Bug 164955 - Create a way to use qt style sheets (qss) for theming/styles: https://bugs.kde.org/show_bug.cgi?id=164955

Qt tools

There is the: Qt5 Configuration Tool - https://www.linux-apps.com/p/1131604/

Change Qt5 application style with qt5ct: http://fixmynix.com/change-qt5-applicat ... ith-qt5ct/
harishpathangay
Registered Member
Posts
25
Karma
0
I would infer that the simple answer is No.
But at leat then can i install kde-style-oxygen4 package in KDE 5?
That way i have 2 widget styles- Oxygen5 and Oxygen 4?
Is this possible?

i do not want to try and messup my system.
thanks,
harish pathangay
wolfi323
Registered Member
Posts
1129
Karma
11
OS
harishpathangay wrote:But at leat then can i install kde-style-oxygen4 package in KDE 5?
That way i have 2 widget styles- Oxygen5 and Oxygen 4?
Is this possible?

You can install it, but it will only be used by KDE4 applications.
KF5/Qt5 applications will still continue to use Oxygen5.

In other words, installing kde-style-oxygen4 won't change the look of KF5/Qt5 applications, as they cannot use it.
And it won't add a "new" Oxygen4 style either.

Maybe have a look at the "QtCurve" style, that's very configurable AFAIK.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar