From d29f4a91b2b71030b3330f1163e291bf3d0650c3 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:20:25 +0900 Subject: [PATCH] fix: use Gtk.TreePath --- dzgui/views/pages/devs.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dzgui/views/pages/devs.py b/dzgui/views/pages/devs.py index 5d99ff1..80f53aa 100644 --- a/dzgui/views/pages/devs.py +++ b/dzgui/views/pages/devs.py @@ -6,6 +6,7 @@ from gi.repository import Gtk from dataclasses import fields from typing import Union, TYPE_CHECKING + from dzgui.const.enum import NotebookPage from dzgui.util.strings import developers from dzgui.util.css import add_class @@ -15,13 +16,11 @@ if TYPE_CHECKING: from dzgui.config.userprefs import UserPrefs from dzgui.config.xdg import Xdg -""" -Shows TreeViews displaying contents of parsed XDG paths and user preferences -""" - -# TODO: make scrollable, test long values/wrapping - class Developers(Gtk.Box): + """ + Shows TreeViews displaying contents of parsed XDG paths + and user preferences + """ def __init__(self, controller: "Controller") -> None: super().__init__( orientation=Gtk.Orientation.VERTICAL, @@ -47,8 +46,9 @@ class Developers(Gtk.Box): prefs_tree = self._make_tree(self.controller.prefs) trees_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=10) - paths_tree.set_cursor(0) - prefs_tree.set_cursor(0) + path = Gtk.TreePath.new_from_indices([0]) + paths_tree.set_cursor(path) + prefs_tree.set_cursor(path) for el in [ paths_label,