Major speed improvement, split the project into several files

This commit is contained in:
2026-03-21 17:52:23 +01:00
parent 75b909cbc3
commit 8f089af0d6
10 changed files with 264 additions and 174 deletions
+24
View File
@@ -0,0 +1,24 @@
import gi
from gi.repository import Gtk
import util
class ModelPreferenceView(Gtk.Popover):
def __init__(self, on_gpu_change=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.on_gpu_change = on_gpu_change
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
util.set_margin_all(box, 8)
label = Gtk.Label(label="GPU Layers")
box.append(label)
gpu_spin = Gtk.SpinButton(adjustment=Gtk.Adjustment(
value=15, lower=0, upper=50, step_increment=1,
), digits=0, hexpand=True)
gpu_spin.connect("value-changed", lambda spin: self.on_gpu_change(spin.get_value_as_int()))
box.append(gpu_spin)
self.set_child(box)