Beispiel #1
0
 def _switch(self, state=None):
     Simple._switch(self, state)
     if self._settings["show_value"] is not False:
         lbl = "%.*f" % (self._settings["show_value"], self.value)
         val = self._settings["label_font"].render(
             lbl, True, self._settings["label_col"])
         x = self._images["handle"].rect.centerx - (val.get_width() / 2)
         x = max(0, min(self.rect.w - val.get_width(), x))
         y = self._images["handle"].rect.top - val.get_height()
         self.image.blit(val, (x, y))
 def _switch(self, state=None):
     Simple._switch(self, state)
     if self._settings["show_value"] is not False:
         lbl = "%.*f" % (self._settings["show_value"], self.value)
         val = self._settings["label_font"].render(
             lbl, True, self._settings["label_col"])
         x = self._images["handle"].rect.centerx - (val.get_width() / 2)
         x = max(0, min(self.rect.w - val.get_width(), x))
         y = self._images["handle"].rect.top - val.get_height()
         self.image.blit(val, (x,y))
Beispiel #3
0
 def _switch(self, state=None):
     Simple._switch(self, state)
     if self.selection > -1:
         val = self._settings["values"][self.selection]
         txt = Font["widget"].render(val, True, Color("black"))
         self.image.blit(txt, (5, (self.rect.h-txt.get_height())/2))
Beispiel #4
0
 def _switch(self, state=None):
     Simple._switch(self, state)
     if self.selection > -1:
         val = self._settings["values"][self.selection]
         txt = Font["widget"].render(val, True, Color("black"))
         self.image.blit(txt, (5, (self.rect.h - txt.get_height()) / 2))