ObjectName of sliders?

Forum to talk about the development of SMPlayer (code, patches...).

ObjectName of sliders?

Postby angela2016 » Wed Nov 16, 2016 8:32 am

Hi,

I've been trying to make a new theme in the last days and managed to change the sliders the way I want them to. The only problem is that the handle sizes are the same for the volume slider and the much wider time slider.
Now, you can define a style for an object name, e.g.:
Code: Select all
QPushButton#add_button {
    background-color: black;
}

which works for the controls defined in the .ui files but I had no luck finding the object names for the two sliders in the source code (note: I'm a very much a newbie in C++ and QT). "MySlider::" works, but naturally for both sliders together.

Can you help me with that?

Thanks,
Angela
angela2016
 
Posts: 5
Joined: Thu Oct 06, 2016 7:20 pm

Re: ObjectName of sliders?

Postby rvm » Wed Nov 16, 2016 10:52 pm

SMTube doesn't support themes.
rvm
Site Admin
 
Posts: 2767
Joined: Wed Dec 23, 2009 1:25 am
Location: España

Re: ObjectName of sliders?

Postby angela2016 » Thu Nov 17, 2016 2:02 am

I"m so sorry. This should have gone into the SMPlayer Development forum, of course. Can you move the post? Thanks.
angela2016
 
Posts: 5
Joined: Thu Oct 06, 2016 7:20 pm

Re: ObjectName of sliders?

Postby angela2016 » Fri Nov 18, 2016 6:59 pm

OK, so apparently no object name is fixed in the code (???, I actually don't have a clue how these things work in C++). So I've tried adding one under VolumeSliderAction::createWidget in the widgetactions.cpp and it works, apparently even if you add two of the same sliders (once again, I'm surprised).

However, I've also found a workaround without compiling by specifying the toolbar in the stylesheet:
For sliders in the main toolbar:
Code: Select all
#toolbar1 QSlider::handle:horizontal {
    width: 10px;
}

In fullscreen:
Code: Select all
#floating_control QSlider::handle:horizontal {
    width: 80px;
}

Controlbar:
Code: Select all
#controlwidget QSlider::handle:horizontal {
    width: 40px;
}


That's presuming the volume slider and the time slider are in different toolbars, of course.
angela2016
 
Posts: 5
Joined: Thu Oct 06, 2016 7:20 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest