@@ -27,9 +27,40 @@ export const ShaderManager = GObject.registerClass(
2727 this . _currentShader = null ;
2828 this . _shaderRows = new Map ( ) ;
2929
30+ this . _setupScrollableContent ( ) ;
3031 this . _loadShaders ( ) ;
3132 }
3233
34+ /**
35+ * Setup scrollable container for shader list
36+ * @private
37+ */
38+ _setupScrollableContent ( ) {
39+ this . _listBox = new Gtk . ListBox ( {
40+ selection_mode : Gtk . SelectionMode . NONE ,
41+ css_classes : [ 'boxed-list' ] ,
42+ } ) ;
43+
44+ this . _scrolledWindow = new Gtk . ScrolledWindow ( {
45+ hscrollbar_policy : Gtk . PolicyType . NEVER ,
46+ vscrollbar_policy : Gtk . PolicyType . AUTOMATIC ,
47+ min_content_height : 300 ,
48+ max_content_height : 600 ,
49+ child : this . _listBox ,
50+ } ) ;
51+
52+ const contentBox = new Gtk . Box ( {
53+ orientation : Gtk . Orientation . VERTICAL ,
54+ margin_top : 12 ,
55+ margin_bottom : 12 ,
56+ margin_start : 12 ,
57+ margin_end : 12 ,
58+ } ) ;
59+
60+ contentBox . append ( this . _scrolledWindow ) ;
61+ this . add_row ( contentBox ) ;
62+ }
63+
3364 /**
3465 * Load available shaders from hyprshade
3566 * @private
@@ -92,7 +123,7 @@ export const ShaderManager = GObject.registerClass(
92123 title : 'No shaders found' ,
93124 subtitle : 'Install shaders to ~/.config/hypr/shaders' ,
94125 } ) ;
95- this . add_row ( emptyRow ) ;
126+ this . _listBox . append ( emptyRow ) ;
96127 return ;
97128 }
98129
@@ -103,7 +134,7 @@ export const ShaderManager = GObject.registerClass(
103134 this . _formatShaderName ( shader ) ,
104135 shader
105136 ) ;
106- this . add_row ( row ) ;
137+ this . _listBox . append ( row ) ;
107138 } ) ;
108139 }
109140
@@ -223,7 +254,7 @@ export const ShaderManager = GObject.registerClass(
223254 title : 'Error' ,
224255 subtitle : message ,
225256 } ) ;
226- this . add_row ( errorRow ) ;
257+ this . _listBox . append ( errorRow ) ;
227258 }
228259
229260 /**
@@ -253,8 +284,13 @@ export const ShaderManager = GObject.registerClass(
253284 * @public
254285 */
255286 refresh ( ) {
256- // Clear existing rows
257- this . remove_all ( ) ;
287+ // Clear existing rows from list box
288+ let child = this . _listBox . get_first_child ( ) ;
289+ while ( child ) {
290+ const next = child . get_next_sibling ( ) ;
291+ this . _listBox . remove ( child ) ;
292+ child = next ;
293+ }
258294
259295 this . _shaderRows . clear ( ) ;
260296 this . _loadShaders ( ) ;
0 commit comments