Redo controls popovers into GtkMenuButtons

This commit is contained in:
Rafał Dzięgiel
2021-09-01 14:25:42 +02:00
parent 04122d46a7
commit bbada8fb4e
10 changed files with 400 additions and 405 deletions

58
ui/elapsed-time-button.ui Normal file
View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ClapperElapsedTimeButton" parent="ClapperPopoverButtonBase">
<property name="popover">popover</property>
<property name="direction">up</property>
<property name="valign">center</property>
<property name="halign">center</property>
<property name="can_focus">False</property>
<style>
<class name="flat"/>
</style>
</template>
<object class="GtkPopover" id="popover">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkScrolledWindow" id="scrolledWindow">
<property name="propagate_natural_width">False</property>
<property name="propagate_natural_height">True</property>
</object>
</child>
<child>
<object class="ClapperPopoverSeparator">
<property name="label" translatable="yes">Speed</property>
</object>
</child>
<child>
<object class="GtkScale" id="speedScale">
<property name="orientation">horizontal</property>
<property name="value_pos">bottom</property>
<property name="draw_value">False</property>
<property name="round_digits">2</property>
<property name="hexpand">True</property>
<property name="valign">center</property>
<property name="adjustment">speed_adjustment</property>
<marks>
<mark value="0.25" position="bottom">0.25x</mark>
<mark value="1" position="bottom" translatable="yes">Normal</mark>
<mark value="2" position="bottom">2x</mark>
</marks>
<style>
<class name="speedscale"/>
</style>
</object>
</child>
</object>
</child>
</object>
<object class="GtkAdjustment" id="speed_adjustment">
<property name="lower">0.01</property>
<property name="upper">2</property>
<property name="value">1</property>
<property name="page-increment">0.1</property>
</object>
</interface>

View File

@@ -3,6 +3,9 @@
<template class="ClapperPopoverSeparator" parent="GtkBox">
<property name="orientation">horizontal</property>
<property name="hexpand">True</property>
<style>
<class name="popoverseparator"/>
</style>
<child>
<object class="GtkSeparator">
<property name="orientation">horizontal</property>

37
ui/track-select-button.ui Normal file
View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ClapperTrackSelectButton" parent="ClapperPopoverButtonBase">
<property name="popover">popover</property>
<property name="direction">up</property>
<property name="valign">center</property>
<property name="halign">center</property>
<property name="can_focus">False</property>
<style>
<class name="flat"/>
</style>
</template>
<object class="GtkPopover" id="popover">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="ClapperPopoverSeparator" id="decoder_separator">
</object>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window">
<property name="propagate_natural_width">True</property>
<property name="propagate_natural_height">True</property>
<child>
<object class="GtkBox" id="popoverBox">
<property name="orientation">vertical</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</interface>

48
ui/volume-button.ui Normal file
View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="ClapperVolumeButton" parent="ClapperPopoverButtonBase">
<property name="icon_name">audio-volume-muted-symbolic</property>
<property name="popover">popover</property>
<property name="direction">up</property>
<property name="valign">center</property>
<property name="halign">center</property>
<property name="can_focus">False</property>
<style>
<class name="flat"/>
</style>
</template>
<object class="GtkPopover" id="popover">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child>
<object class="GtkScale" id="volumeScale">
<property name="orientation">vertical</property>
<property name="inverted">True</property>
<property name="value_pos">top</property>
<property name="draw_value">False</property>
<property name="vexpand">True</property>
<property name="adjustment">volume_adjustment</property>
<signal name="value-changed" handler="_onVolumeScaleValueChanged"/>
<marks>
<mark value="0" position="left">0%</mark>
<mark value="1" position="left">100%</mark>
<mark value="1.5" position="left">150%</mark>
</marks>
<style>
<class name="volumescale"/>
</style>
</object>
</child>
</object>
</child>
</object>
<object class="GtkAdjustment" id="volume_adjustment">
<property name="lower">0</property>
<property name="upper">1.5</property>
<property name="step-increment">0.05</property>
<property name="page-increment">0.05</property>
</object>
</interface>