Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
packages
tools
anonsurf
Commits
ad864446
Commit
ad864446
authored
Aug 25, 2021
by
Nong Hoang Tu
Browse files
restore icons module
parent
a6c9cd8b
Pipeline
#3759
canceled with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nimsrc/anonsurf/AnonSurfGTK.nim
View file @
ad864446
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
/
image
s
import
gtk
/
anonsurf_icon
s
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",
onClickS
top)
# mainBoard.connect("destroy",
ansurf_gtk_do_s
top)
gtk
.
main
()
main
()
nimsrc/anonsurf/gtk/anonsurf_icons.nim
0 → 100644
View file @
ad864446
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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment