reimplement alpha slider

This commit is contained in:
David Robertson
2020-05-02 04:09:07 +01:00
parent b6593b41e2
commit 84566301ce
3 changed files with 106 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
from typing import Union
from PyQt5 import QtWidgets
from flatcamGUI.GUIElements import RadioSet, FCCheckBox, FCButton, FCComboBox, FCEntry, FCSpinner, FCColorEntry
from flatcamGUI.GUIElements import RadioSet, FCCheckBox, FCButton, FCComboBox, FCEntry, FCSpinner, FCColorEntry, \
FCSliderWithSpinner
import gettext
import FlatCAMTranslation as fcTranslate
@@ -106,6 +107,18 @@ class ColorOptionUI(BasicOptionUI):
return entry
class SliderWithSpinnerOptionUI(BasicOptionUI):
def __init__(self, option: str, label_text: str, label_tooltip: str, min=0, max=100, step=1):
self.min = min
self.max = max
self.step = step
super().__init__(option=option, label_text=label_text, label_tooltip=label_tooltip)
def build_entry_widget(self) -> QtWidgets.QWidget:
entry = FCSliderWithSpinner(min=self.min, max=self.max, step=self.step)
return entry
class HeadingOptionUI(OptionUI):
def __init__(self, label_text: str, label_tooltip: Union[str, None]):
super().__init__(option="__heading")