def after_move(self): self.v_scrollbar.size = self.o.rows / self._content_height self.h_scrollbar.size = self.o.cols / self._content_width self.h_scroll_index = clamp(self.h_scroll_index, 0, self._content_height - self.o.rows + 1) self.v_scroll_index = clamp(self.v_scroll_index, 0, self._content_width - self.o.cols + 1) self.v_scrollbar.progress = self.h_scroll_index / self._content_height self.h_scrollbar.progress = self.v_scroll_index / self._content_width self.refresh()
def move_to_entry(self, index): if self.pointer == index: #Moving to the same item that's already selected #let's interpret this as KEY_ENTER self.current_input = None self.select_entry() return self.pointer = clamp(index, 0, len(self.contents) - 1) self.current_input = None self.view.refresh()
def progress(self, value): if value == self.progress: return self.last_activity = time() self._progress = clamp(value, 0, 1)
def progress(self, value): self._progress = clamp(value, 0, 1)
def progress(self, value): self._progress = clamp(value, 0, 100) self.refresh()