mirror of
https://github.com/gen2brain/cbconvert
synced 2026-06-30 09:11:54 +02:00
Add page spin to preview other pages
This commit is contained in:
@@ -33,6 +33,10 @@ var (
|
||||
|
||||
activeConv *cbconvert.Converter
|
||||
busy bool
|
||||
|
||||
previewPage int // 0-based page shown in the preview
|
||||
previewPath string // path of the file whose page range is loaded
|
||||
hasCover bool // whether a cover image is loaded for the preview canvas
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -78,7 +82,7 @@ func main() {
|
||||
img, _ := png.Decode(bytes.NewReader(appLogo))
|
||||
iup.ImageFromImage(img).SetHandle("logo")
|
||||
|
||||
dlg := iup.Dialog(layout()).SetAttributes(fmt.Sprintf(`TITLE="CBconvert %s", ICON=logo, SHRINK=YES`, appVersion)).SetHandle("dlg")
|
||||
dlg := iup.Dialog(layout()).SetAttributes(fmt.Sprintf(`TITLE="CBconvert %s", ICON=logo`, appVersion)).SetHandle("dlg")
|
||||
|
||||
dlg.SetCallback("POSTMESSAGE_CB", iup.PostMessageFunc(func(ih iup.Ihandle, s string, i int, p any) int {
|
||||
sp := strings.Split(s, ": ")
|
||||
@@ -89,15 +93,6 @@ func main() {
|
||||
return iup.DEFAULT
|
||||
}))
|
||||
|
||||
dlg.SetCallback("RESIZE_CB", iup.ResizeFunc(func(ih iup.Ihandle, width, height int) int {
|
||||
iup.GetHandle("Preview").SetAttribute("IMAGE", "logo")
|
||||
iup.Refresh(ih)
|
||||
|
||||
previewPost()
|
||||
|
||||
return iup.DEFAULT
|
||||
}))
|
||||
|
||||
dlg.SetCallback("THEMECHANGED_CB", iup.ThemeChangedFunc(func(ih iup.Ihandle, darkMode int) int {
|
||||
t := iup.GetHandle("Table")
|
||||
tableRowColors(t, darkMode == 1)
|
||||
|
||||
Reference in New Issue
Block a user