2025-02-01 11:57:52 -06:00
|
|
|
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by the GPL 3.0
|
|
|
|
|
2024-02-17 14:20:37 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"go.wit.com/lib/gadgets"
|
|
|
|
|
|
|
|
"go.wit.com/gui"
|
|
|
|
)
|
|
|
|
|
|
|
|
type repoWindow struct {
|
2025-02-14 19:15:39 -06:00
|
|
|
win *gadgets.BasicWindow // the window widget itself
|
|
|
|
box *gui.Node // notsure
|
|
|
|
topbox *gui.Node // the top box of the repolist window
|
2024-02-17 14:20:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repoWindow) Hidden() bool {
|
2025-02-13 20:47:40 -06:00
|
|
|
if r == nil {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
if r.win == nil {
|
|
|
|
return true
|
|
|
|
}
|
2024-02-17 14:20:37 -06:00
|
|
|
return r.win.Hidden()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repoWindow) Show() {
|
2025-02-13 20:47:40 -06:00
|
|
|
if r == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if r.win == nil {
|
|
|
|
return
|
|
|
|
}
|
2024-02-17 14:20:37 -06:00
|
|
|
r.win.Show()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repoWindow) Hide() {
|
2025-02-13 20:47:40 -06:00
|
|
|
if r == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if r.win == nil {
|
|
|
|
return
|
|
|
|
}
|
2024-02-17 14:20:37 -06:00
|
|
|
r.win.Hide()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repoWindow) Disable() {
|
2025-02-13 20:47:40 -06:00
|
|
|
if r == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if r.box == nil {
|
|
|
|
return
|
|
|
|
}
|
2024-02-17 14:20:37 -06:00
|
|
|
r.box.Disable()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repoWindow) Enable() {
|
2025-02-13 20:47:40 -06:00
|
|
|
if r == nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if r.box == nil {
|
|
|
|
return
|
|
|
|
}
|
2024-02-17 14:20:37 -06:00
|
|
|
r.box.Enable()
|
|
|
|
}
|