Exemplo n.º 1
0
 def apply_settings(self):
     self.keyboard.finalize()
     self.setDockNestingEnabled(tprefs['nestable_dock_widgets'])
     for v, h in product(('top', 'bottom'), ('left', 'right')):
         p = 'dock_%s_%s' % (v, h)
         area = getattr(Qt, '%sDockWidgetArea' % capitalize({'vertical':h, 'horizontal':v}[tprefs[p] or tprefs.defaults[p]]))
         self.setCorner(getattr(Qt, '%s%sCorner' % tuple(map(capitalize, (v, h)))), area)
     self.preview.apply_settings()
Exemplo n.º 2
0
 def apply_settings(self):
     self.keyboard.finalize()
     self.setDockNestingEnabled(tprefs['nestable_dock_widgets'])
     for v, h in product(('top', 'bottom'), ('left', 'right')):
         p = 'dock_%s_%s' % (v, h)
         pref = tprefs[p] or tprefs.defaults[p]
         area = getattr(Qt, '%sDockWidgetArea' % capitalize({'vertical':h, 'horizontal':v}[pref]))
         self.setCorner(getattr(Qt, '%s%sCorner' % tuple(map(capitalize, (v, h)))), area)
     self.preview.apply_settings()
Exemplo n.º 3
0
 def apply_settings(self):
     self.keyboard.finalize()
     self.setDockNestingEnabled(tprefs["nestable_dock_widgets"])
     for v, h in product(("top", "bottom"), ("left", "right")):
         p = "dock_%s_%s" % (v, h)
         pref = tprefs[p] or tprefs.defaults[p]
         area = getattr(Qt, "%sDockWidgetArea" % capitalize({"vertical": h, "horizontal": v}[pref]))
         self.setCorner(getattr(Qt, "%s%sCorner" % tuple(map(capitalize, (v, h)))), area)
     self.preview.apply_settings()
     self.live_css.apply_theme()
Exemplo n.º 4
0
 def apply_settings(self):
     self.keyboard.finalize()
     self.setDockNestingEnabled(tprefs['nestable_dock_widgets'])
     for v, h in product(('top', 'bottom'), ('left', 'right')):
         p = 'dock_%s_%s' % (v, h)
         pref = tprefs[p] or tprefs.defaults[p]
         area = getattr(Qt, '%sDockWidgetArea' % capitalize({'vertical':h, 'horizontal':v}[pref]))
         self.setCorner(getattr(Qt, '%s%sCorner' % tuple(map(capitalize, (v, h)))), area)
     self.preview.apply_settings()
     self.live_css.apply_theme()
     for bar in (self.global_bar, self.tools_bar, self.plugins_bar):
         bar.setIconSize(QSize(tprefs['toolbar_icon_size'], tprefs['toolbar_icon_size']))
Exemplo n.º 5
0
 def apply_settings(self):
     self.keyboard.finalize()
     self.setDockNestingEnabled(tprefs['nestable_dock_widgets'])
     for v, h in product(('top', 'bottom'), ('left', 'right')):
         p = 'dock_%s_%s' % (v, h)
         pref = tprefs[p] or tprefs.defaults[p]
         area = getattr(Qt, '%sDockWidgetArea' % capitalize({'vertical':h, 'horizontal':v}[pref]))
         self.setCorner(getattr(Qt, '%s%sCorner' % tuple(map(capitalize, (v, h)))), area)
     self.preview.apply_settings()
     self.live_css.apply_theme()
     for bar in (self.global_bar, self.tools_bar, self.plugins_bar):
         bar.setIconSize(QSize(tprefs['toolbar_icon_size'], tprefs['toolbar_icon_size']))
Exemplo n.º 6
0
 def move_edge(self, edge, dp):
     sr = self.selection_state.rect
     horiz = edge in {'left', 'right'}
     func = getattr(sr, 'set' + capitalize(edge))
     delta = getattr(dp, 'x' if horiz else 'y')()
     buf = 50
     if horiz:
         minv = self.target.left() if edge == 'left' else sr.left() + buf
         maxv = sr.right() - buf if edge == 'left' else self.target.right()
     else:
         minv = self.target.top() if edge == 'top' else sr.top() + buf
         maxv = sr.bottom() - buf if edge == 'top' else self.target.bottom()
     func(max(minv, min(maxv, delta + getattr(sr, edge)())))
Exemplo n.º 7
0
 def move_edge(self, edge, dp):
     sr = self.selection_state.rect
     horiz = edge in {'left', 'right'}
     func = getattr(sr, 'set' + capitalize(edge))
     delta = getattr(dp, 'x' if horiz else 'y')()
     buf = 50
     if horiz:
         minv = self.target.left() if edge == 'left' else sr.left() + buf
         maxv = sr.right() - buf if edge == 'left' else self.target.right()
     else:
         minv = self.target.top() if edge == 'top' else sr.top() + buf
         maxv = sr.bottom() - buf if edge == 'top' else self.target.bottom()
     func(max(minv, min(maxv, delta + getattr(sr, edge)())))
Exemplo n.º 8
0
 def move_edge(self, edge, dp):
     sr = self.selection_state.rect
     horiz = edge in {"left", "right"}
     func = getattr(sr, "set" + capitalize(edge))
     delta = getattr(dp, "x" if horiz else "y")()
     buf = 50
     if horiz:
         minv = self.target.left() if edge == "left" else sr.left() + buf
         maxv = sr.right() - buf if edge == "left" else self.target.right()
     else:
         minv = self.target.top() if edge == "top" else sr.top() + buf
         maxv = sr.bottom() - buf if edge == "top" else self.target.bottom()
     func(max(minv, min(maxv, delta + getattr(sr, edge)())))