top_bar.py 850 B

1234567891011121314151617181920212223242526272829
  1. import pygame
  2. import config_manager as config
  3. import skin_manager as SkinManager
  4. import GdUI as UI
  5. class TopBar(UI.FlowContainer):
  6. def __init__(self, width, height):
  7. super().__init__(x=0, y=0, width=width, height=25)
  8. self.set_bgcolor(SkinManager.get_color("title_bg"))
  9. self._bottomline = UI.Widget(x=0, y=24, width=width, height=1, bg_color=SkinManager.get_color("line"))
  10. # Title on top
  11. self._TitleLbl = UI.Label(color=SkinManager.get_color("text"), font_obj=UI.FontManager.get_font("varela_16"),
  12. text="")
  13. self.add_left_child(self._TitleLbl)
  14. self.add_child(self._bottomline)
  15. def set_title(self, title):
  16. self._TitleLbl.set_text(title)
  17. def reload(self):
  18. # Do nothing for now, later reload info from skinmanager
  19. pass