Skip to content

skins: add Slider bars#2694

Merged
Holzhaus merged 1 commit intomixxxdj:masterfrom
ronso0:slider-bars
Apr 22, 2020
Merged

skins: add Slider bars#2694
Holzhaus merged 1 commit intomixxxdj:masterfrom
ronso0:slider-bars

Conversation

@ronso0
Copy link
Copy Markdown
Member

@ronso0 ronso0 commented Apr 21, 2020

...so that the knob arcs #2686 don't feel so posh :)

slider_bars

Bars can be used alone or in conjunction with slider graphics.
When used alone, experimtent with <Size>, <BarMargins> to yield a proper (read: tolerant) touch/click-responsive surface.

Note: Margins are absolute values, so if you want to use graphics AND dynamic sizes (stretched graphics) it won't work well as of now.

<SliderComposed>
  <TooltipId>channel_volume</TooltipId>
  <Size>46f,107f</Size>
  <Horizontal>false</Horizontal>

  <BarColor>#ff8800</BarColor> any valid hex or rgba color
  <BarWidth>4.0</BarWidth> width in pixels
  <BarMargins>9,9</BarMargins> bar start,end. left,right / top,bottom respectively
  <BarAxisPos>23.0</BarAxisPos> shifts bar from left or top
  <BarBgColor>#050505</BarBgColor> enables background bar
  <BarBgWidth>8.0</BarBgWidth> optional, adopt <BarWidth> if empty
  <BarBgMargins>7,7</BarBgMargins> optional, adopt <BarMargins> if empty

  <Connection>
    <ConfigKey><Variable name="group"/>,volume</ConfigKey>
  </Connection>
</SliderComposed>

ToDo

  • remove demo styles

@ronso0 ronso0 added the skins label Apr 21, 2020
@ronso0 ronso0 added this to the 2.3.0 milestone Apr 21, 2020
@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Apr 21, 2020

Let me know when you consider this ready for merge. I'll remove the demo styles then.

Comment thread src/widget/wslidercomposed.cpp Outdated
Copy link
Copy Markdown
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good so far, I'll test this tomorrow.

Comment thread src/widget/wslidercomposed.cpp Outdated
Comment thread src/widget/wslidercomposed.cpp Outdated
Copy link
Copy Markdown
Member

@Holzhaus Holzhaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks great. LGTM (except for the small comments I posted above).

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Apr 22, 2020

Okay, cool.
I'll force-push this without demo styles and with some simplifications, for example just adopt the the main bar's width/margin if a valid color is set for the background.

@Holzhaus
Copy link
Copy Markdown
Member

@ronso0 Ready?

@ronso0
Copy link
Copy Markdown
Member Author

ronso0 commented Apr 22, 2020

@ronso0 Ready?

Yup!

Draw a bar underneath the slider handle that corresponds represents
the parameter value. New <WSliderComposed> nodes for skin styles:
* BarWidth [double] width of the bar
* BarAxisPos [double] shifts bar center
    horizontal: from top
    vertial: from left
* BarMargins [int,int] start/end point of bar
    horizontal: left, right
    vertical: top, bottom
* BarBgMargins [int,int] (optional, adopts BarMargins if empty)
* BarColor [valid hex/rgba/... color]
* BarBgColor [hex/rgba/... color] optional
* BarUnipolar [bool] (default: true)
    draw from bottom/left or from center, considering BarMargins
@Holzhaus Holzhaus merged commit 1958a7c into mixxxdj:master Apr 22, 2020
@ronso0 ronso0 deleted the slider-bars branch April 22, 2020 20:47
@ronso0 ronso0 mentioned this pull request May 9, 2020
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants