Page 1 of 1

ObjectName of sliders?

PostPosted: Wed Nov 16, 2016 8:32 am
by angela2016
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

Re: ObjectName of sliders?

PostPosted: Wed Nov 16, 2016 10:52 pm
by rvm
SMTube doesn't support themes.

Re: ObjectName of sliders?

PostPosted: Thu Nov 17, 2016 2:02 am
by angela2016
I"m so sorry. This should have gone into the SMPlayer Development forum, of course. Can you move the post? Thanks.

Re: ObjectName of sliders?

PostPosted: Fri Nov 18, 2016 6:59 pm
by angela2016
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.