def cmd_tile(self): AutoTile.cmd_tile(self) m_size = len(self.store.masters) s_size = len(self.store.slaves) if not m_size and not s_size: return rows = int(math.ceil(float(s_size) / float(self.columns))) lastrow_columns = s_size % self.columns or self.columns m_width = int(self.monitor.wa_width * self.hsplit) m_height = int(self.monitor.wa_height * self.vsplit) m_x = self.monitor.wa_x + int((self.monitor.wa_width - m_width) / 2) m_y = self.monitor.wa_y + int((self.monitor.wa_height - m_height) / 2) s_width = int(self.monitor.wa_width / self.columns) if not rows: s_height = 1 else: s_height = int(self.monitor.wa_height / rows) s_x = self.monitor.wa_x s_y = self.monitor.wa_y if ( m_width <= 0 or m_width > self.monitor.wa_width or s_width <= 0 or s_width > self.monitor.wa_width or m_height <= 0 or m_height > self.monitor.wa_height or s_height <= 0 or s_height > self.monitor.wa_height ): self.error_exec_callbacks() return for i, cont in enumerate(self.store.masters): cont.moveresize( m_x, m_y, m_width, m_height ) for i, cont in enumerate(self.store.slaves): if i / self.columns == rows - 1: s_width = self.monitor.wa_width / lastrow_columns cont.moveresize( s_x + (i % self.columns) * s_width, s_y + (i / self.columns) * s_height, s_width, s_height ) # If we've made it this far, then we've supposedly tiled correctly self.error_clear()
def cmd_tile(self): AutoTile.cmd_tile(self) m_size = len(self.store.masters) s_size = len(self.store.slaves) if not m_size and not s_size: return m_width = int(self.monitor.wa_width * self.hsplit) s_width = self.monitor.wa_width - m_width m_x = self.monitor.wa_x s_x = m_x + m_width if ( m_width <= 0 or m_width > self.monitor.wa_width or s_width <= 0 or s_width > self.monitor.wa_width ): self.error_exec_callbacks() return if m_size: m_height = self.monitor.wa_height / m_size if not s_size: m_width = self.monitor.wa_width for i, cont in enumerate(self.store.masters): cont.moveresize( m_x, self.monitor.wa_y + i * m_height, m_width, m_height ) if s_size: s_height = self.monitor.wa_height / s_size if not m_size: s_width = self.monitor.wa_width s_x = self.monitor.wa_x for i, cont in enumerate(self.store.slaves): cont.moveresize( s_x, self.monitor.wa_y + i * s_height, s_width, s_height ) # If we've made it this far, then we've supposedly tiled correctly self.error_clear()
def cmd_tile(self): AutoTile.cmd_tile(self) m_size = len(self.store.masters) s_size = len(self.store.slaves) if not m_size and not s_size: return m_height = int(self.monitor.wa_height * self.vsplit) s_height = self.monitor.wa_height - m_height m_y = self.monitor.wa_y s_y = m_y + m_height if ( m_height <= 0 or m_height > self.monitor.wa_height or s_height <= 0 or s_height > self.monitor.wa_height ): self.error_exec_callbacks() return if m_size: m_width = self.monitor.wa_width / m_size if not s_size: m_height = self.monitor.wa_height for i, cont in enumerate(self.store.masters): cont.moveresize( self.monitor.wa_x + i * m_width, m_y, m_width, m_height ) if s_size: s_width = self.monitor.wa_width / s_size if not m_size: s_height = self.monitor.wa_height s_y = self.monitor.wa_y for i, cont in enumerate(self.store.slaves): cont.moveresize( self.monitor.wa_x + i * s_width, s_y, s_width, s_height ) # If we've made it this far, then we've supposedly tiled correctly self.error_clear()
def cmd_tile(self): AutoTile.cmd_tile(self) if not self.store.all(): return # Do master last, in case decorations are disabled # and we need to draw the "active" border (so it # over laps the "inactive" borders). for cont in sorted(self.store.all(), reverse=True): cont.moveresize( self.monitor.wa_x, self.monitor.wa_y, self.monitor.wa_width, self.monitor.wa_height ) # If we've made it this far, then we've supposedly tiled correctly self.error_clear()
def cmd_tile(self): AutoTile.cmd_tile(self) m_size = len(self.store.masters) s_size = len(self.store.slaves) if not m_size and not s_size: return columns = int(math.ceil(float(s_size) / float(self.rows))) lastcolumn_rows = s_size % self.rows or self.rows m_width = int(self.monitor.wa_width * self.hsplit) if not columns: s_width = 1 else: s_width = (self.monitor.wa_width - m_width) / columns m_x = self.monitor.wa_x s_x = m_x + m_width if ( m_width <= 0 or m_width > self.monitor.wa_width or s_width <= 0 or s_width > self.monitor.wa_width ): self.error_exec_callbacks() return if m_size: m_height = self.monitor.wa_height / m_size if not s_size: m_width = self.monitor.wa_width for i, cont in enumerate(self.store.masters): cont.moveresize( m_x, self.monitor.wa_y + i * m_height, m_width, m_height ) if s_size: s_height = self.monitor.wa_height / self.rows if not m_size: s_width = self.monitor.wa_width / columns s_x = self.monitor.wa_x column = 0 for i, cont in enumerate(self.store.slaves): if column == columns - 1: s_height = self.monitor.wa_height / lastcolumn_rows cont.moveresize( s_x + column * s_width, self.monitor.wa_y + (i % self.rows) * s_height, s_width, s_height ) if not (i + 1) % self.rows: column += 1 # If we've made it this far, then we've supposedly tiled correctly self.error_clear()
def cmd_tile(self): AutoTile.cmd_tile(self) m_size = len(self.store.masters) s_size = len(self.store.slaves) if not m_size and not s_size: return push_down = self.get_option('push_down') push_over = self.get_option('push_over') if self.get_option('horz_align') == 'right': push_over = -push_over m_width = int( self.monitor.wa_width * self.hsplit - push_over * s_size ) m_height = int( self.monitor.wa_height * self.vsplit - push_down * s_size ) m_y = self.monitor.wa_y + push_down * s_size s_width = int(self.monitor.wa_width * self.hsplit) s_height = int(self.monitor.wa_height * self.vsplit) s_y = self.monitor.wa_y if ( m_width <= 0 or m_width > self.monitor.wa_width or s_width <= 0 or s_width > self.monitor.wa_width or m_height <= 0 or m_height > self.monitor.wa_height or s_height <= 0 or s_height > self.monitor.wa_height ): self.error_exec_callbacks() return if self.get_option('horz_align') == 'right': m_x = ( self.monitor.wa_x + (self.monitor.wa_width - m_width) + (push_over * s_size) ) s_x = self.monitor.wa_x + (self.monitor.wa_width - s_width) else: m_x = self.monitor.wa_x + (push_over * s_size) s_x = self.monitor.wa_x for i, cont in enumerate(self.store.slaves): cont.moveresize( s_x + (i * push_over), s_y + (i * push_down), s_width - (i * push_over), s_height - (i * push_down) ) cont.window_raise() for i, cont in enumerate(self.store.masters): cont.moveresize( m_x, m_y, m_width, m_height ) cont.window_raise() self.raise_active() # If we've made it this far, then we've supposedly tiled correctly self.error_clear()