script_dir="$(realpath -Pe "$(dirname "${0}")")"
executable="${script_dir}/zenbook_conf.py"
icon="${script_dir}/laptop-single.svg"
+name="Zenbook Duo Settings"
help() {
echo " ${0} [--executable PATH] [--icon PATH] [--virtual-env PATH] | -h|--help"
echo "Create a desktop launcher for zenbook_conf.py"
echo " --executable PATH specify the executable"
echo " --icon PATH specify the icon"
- echo " --virtual-env PATH specify a VIRTUAL_ENV path"
+ echo " --name NAME specify the name"
echo " -h | --help show this help message"
exit 0
}
icon="${2}"
shift
;;
+ --name)
+ name="${2}"
+ shift
+ ;;
-h|--help)
help=1
;;
echo "[Desktop Entry]"
echo "Type=Application"
echo "Exec=$(realpath -Pe "${executable}")"
-echo "Icon=$(realpath -Pe "${icon}")"
+echo "Icon=${icon}"
echo ""
-echo "Name=Zenbook Duo settings"
+echo "Name=${name}"
import pygame
-from ui import Child, LabelledRect, QuittableModal, Rect
+from ui import Child, DraggableButton, LabelledRect, QuittableModal, Rect
from .clock import ClockWidget
-from .draggable import DraggableButton
from .key import apply_y_spans, get_key_size
from .mousepad import MousePadWidget
from .touchbutton import TouchButton
from .button import Button
from .child import Child
from .color_button import ColorButton
+from .draggable_button import DraggableButton
from .drop_down import DropDown
from .event_method_dispatcher import EventMethodDispatcher
from .fps_widget import FPSWidget
"Button",
"Child",
"ColorButton",
+ "DraggableButton",
"DropDown",
"EventMethodDispatcher",
"FloatSpinner",
class DraggableButton(Child):
- def __init__(self, parent, rect, surf, dests, callback, highlight=False):
+ def __init__(self, parent, rect, surf, dests, callback):
+ """
+ dests is a list of rects, or a tuple (check_func, rect)
+ that allows defining as drop zone that differs from the actual destination
+ """
super().__init__(parent)
assert rect.size == surf.get_size()
self.rect = rect
self.surface = surf
self.dests = dests
self.callback = callback
- self.highlight = highlight
self.pushed = None
self.drag_pos = None
self.drag_rel = None