pm_scanLayer.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # THIS FILE IS A PART OF VCStudio
  2. # PYTHON 3
  3. # This a console project manager.
  4. import os
  5. # GTK module ( Graphical interface
  6. import gi
  7. gi.require_version('Gtk', '3.0')
  8. from gi.repository import Gtk
  9. from gi.repository import GLib
  10. from gi.repository import Gdk
  11. import cairo
  12. # Own modules
  13. from settings import settings
  14. from settings import talk
  15. from project_manager import pm_project
  16. #UI modules
  17. from UI import UI_elements
  18. from UI import UI_color
  19. def layer(win):
  20. # Making the layer
  21. surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, win.current['w'],
  22. win.current['h'])
  23. layer = cairo.Context(surface)
  24. #text setting
  25. layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
  26. UI_color.set(layer, win, "dark_overdrop")
  27. layer.rectangle(
  28. 0,
  29. 0,
  30. win.current["w"],
  31. win.current["h"],
  32. )
  33. layer.fill()
  34. # So it's going to be like a little window in the center of the VCStudio
  35. # with a simple UI. Probably like 2 things. Folder and a projectname.
  36. UI_color.set(layer, win, "node_background")
  37. UI_elements.roundrect(layer, win,
  38. win.current["w"]/2-250,
  39. win.current["h"]/2-50,
  40. 500,
  41. 100,
  42. 10)
  43. # Title of the operation. Incase the user forgot.
  44. UI_elements.text(layer, win, "scan_project_title",
  45. win.current["w"]/2-250,
  46. win.current["h"]/2-15,
  47. 500,
  48. 30,
  49. 10,
  50. fill=False,
  51. centered=True,
  52. editable=False)
  53. win.text["scan_project_title"]["text"] = talk.text("duringscanningforprojects")
  54. blur = UI_elements.animate("project_manager_blur", win)
  55. if blur > 49:
  56. pm_project.scan()
  57. win.url = "project_manager"
  58. return surface