Commit ad864446 authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

restore icons module

parent a6c9cd8b
Pipeline #3759 canceled with stages
import gintro / [gtk, glib, gobject]
# import gtk / displays / [detailPage, mainPage, bottombar]
# import gtk / cores / [status, refresher, images]
# import gtk / actions / [actDetailPage, actMainPage, gtkClick]
import cores / [handle_activities, handle_killapps]
import gtk / widgets / [details_widget, main_widget, bottom_widget]
import gtk / old_cores / images
import gtk / anonsurf_icons
import gtk / gui_activities / [details_widget_activities, main_widget_activities, core_activities]
# type
......@@ -130,7 +128,7 @@ proc main =
mainBoard.setResizable(false)
mainBoard.title = "AnonSurf GUI"
# mainBoard.setIcon(surfIcon)
mainBoard.setIcon(surfIcon)
mainBoard.setPosition(WindowPosition.center)
createArea(boxMainWindow)
......@@ -139,7 +137,7 @@ proc main =
mainBoard.setBorderWidth(3)
mainBoard.show()
# mainBoard.connect("destroy", onClickStop)
# mainBoard.connect("destroy", ansurf_gtk_do_stop)
gtk.main()
main()
import gintro / gdkpixbuf
#[
Load image from icons make to "embedded" icons
]#
type
AnonImgBuf* = object
imgSecLow*: Pixbuf
imgSecMed*: Pixbuf
imgSecHigh*: Pixbuf
imgBootOn*: Pixbuf
imgBootOff*: Pixbuf
proc initImgs(): AnonImgBuf =
const
imgSecLow = staticRead("../../../icons/sec-low.svg")
imgSecMed = staticRead("../../../icons/sec-med.svg")
imgSecHigh = staticRead("../../../icons/sec-high.svg")
imgBootOff = staticRead("../../../icons/boot-off.svg")
imgBootOn = staticRead("../../../icons/boot-on.svg")
let loadLow = newPixbufLoader()
discard loadLow.write(imgSecLow)
discard loadLow.close()
result.imgSecLow = loadLow.getPixbuf()
let loadMed = newPixbufLoader()
discard loadMed.write(imgSecMed)
discard loadMed.close()
result.imgSecMed = loadMed.getPixbuf()
let loadHigh = newPixbufLoader()
discard loadHigh.write(imgSecHigh)
discard loadHigh.close()
result.imgSecHigh = loadHigh.getPixbuf()
let loadOff = newPixbufLoader()
discard loadOff.write(imgBootOff)
discard loadOff.close()
result.imgBootOff = loadOff.getPixbuf()
let loadOn = newPixbufLoader()
discard loadOn.write(imgBootOn)
discard loadOn.close()
result.imgBootOn = loadOn.getPixbuf()
proc surfIconPixbuf(): Pixbuf =
const
imgData = staticRead("../../../icons/anonsurf.png")
let loadData = newPixbufLoader()
discard loadData.write(imgData)
discard loadData.close()
result = loadData.getPixbuf()
proc exitIconPixbuf(): Pixbuf =
const
imgData = staticRead("../../../icons/exit.png")
let loadData = newPixbufLoader()
discard loadData.write(imgData)
discard loadData.close()
result = loadData.getPixbuf()
proc aboutIconPixbuf(): Pixbuf =
const
imgData = staticRead("../../../icons/help-about.png")
let loadData = newPixbufLoader()
discard loadData.write(imgData)
discard loadData.close()
result = loadData.getPixbuf()
let
surfImages* = initImgs()
surfIcon* = surfIconPixbuf()
# reloadIcon* = reloadIconPixbuf()
exitIcon* = exitIconPixbuf()
aboutIcon* = aboutIconPixbuf()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment