Browse Source

Place ports on the edge in modern themes for easier look, and...

What about to deliver to theming, wether ports cover group edge or not?
pull/170/head
Nikita Zlobin 8 years ago
parent
commit
a61c15e6a1
2 changed files with 10 additions and 10 deletions
  1. +8
    -8
      src/patchcanvas.py
  2. +2
    -2
      src/patchcanvas_theme.py

+ 8
- 8
src/patchcanvas.py View File

@@ -2226,14 +2226,14 @@ class CanvasBox(QGraphicsItem):
for port in port_list: for port in port_list:
if port.port_type == PORT_TYPE_AUDIO_JACK: if port.port_type == PORT_TYPE_AUDIO_JACK:
if port.port_mode == PORT_MODE_INPUT: if port.port_mode == PORT_MODE_INPUT:
port.widget.setPos(QPointF(1 + canvas.theme.port_offset, last_in_pos))
port.widget.setPos(QPointF(canvas.theme.port_offset, last_in_pos))
port.widget.setPortWidth(max_in_width) port.widget.setPortWidth(max_in_width)


last_in_pos += port_spacing last_in_pos += port_spacing
last_in_type = port.port_type last_in_type = port.port_type


elif port.port_mode == PORT_MODE_OUTPUT: elif port.port_mode == PORT_MODE_OUTPUT:
port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 13, last_out_pos))
port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 12, last_out_pos))
port.widget.setPortWidth(max_out_width) port.widget.setPortWidth(max_out_width)


last_out_pos += port_spacing last_out_pos += port_spacing
@@ -2246,7 +2246,7 @@ class CanvasBox(QGraphicsItem):
if last_in_type != PORT_TYPE_NULL and port.port_type != last_in_type: if last_in_type != PORT_TYPE_NULL and port.port_type != last_in_type:
last_in_pos += canvas.theme.port_spacingT last_in_pos += canvas.theme.port_spacingT


port.widget.setPos(QPointF(1 + canvas.theme.port_offset, last_in_pos))
port.widget.setPos(QPointF(canvas.theme.port_offset, last_in_pos))
port.widget.setPortWidth(max_in_width) port.widget.setPortWidth(max_in_width)


last_in_pos += port_spacing last_in_pos += port_spacing
@@ -2256,7 +2256,7 @@ class CanvasBox(QGraphicsItem):
if last_out_type != PORT_TYPE_NULL and port.port_type != last_out_type: if last_out_type != PORT_TYPE_NULL and port.port_type != last_out_type:
last_out_pos += canvas.theme.port_spacingT last_out_pos += canvas.theme.port_spacingT


port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 13, last_out_pos))
port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 12, last_out_pos))
port.widget.setPortWidth(max_out_width) port.widget.setPortWidth(max_out_width)


last_out_pos += port_spacing last_out_pos += port_spacing
@@ -2269,7 +2269,7 @@ class CanvasBox(QGraphicsItem):
if last_in_type != PORT_TYPE_NULL and port.port_type != last_in_type: if last_in_type != PORT_TYPE_NULL and port.port_type != last_in_type:
last_in_pos += canvas.theme.port_spacingT last_in_pos += canvas.theme.port_spacingT


port.widget.setPos(QPointF(1 + canvas.theme.port_offset, last_in_pos))
port.widget.setPos(QPointF(canvas.theme.port_offset, last_in_pos))
port.widget.setPortWidth(max_in_width) port.widget.setPortWidth(max_in_width)


last_in_pos += port_spacing last_in_pos += port_spacing
@@ -2279,7 +2279,7 @@ class CanvasBox(QGraphicsItem):
if last_out_type != PORT_TYPE_NULL and port.port_type != last_out_type: if last_out_type != PORT_TYPE_NULL and port.port_type != last_out_type:
last_out_pos += canvas.theme.port_spacingT last_out_pos += canvas.theme.port_spacingT


port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 13, last_out_pos))
port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 12, last_out_pos))
port.widget.setPortWidth(max_out_width) port.widget.setPortWidth(max_out_width)


last_out_pos += port_spacing last_out_pos += port_spacing
@@ -2292,7 +2292,7 @@ class CanvasBox(QGraphicsItem):
if last_in_type != PORT_TYPE_NULL and port.port_type != last_in_type: if last_in_type != PORT_TYPE_NULL and port.port_type != last_in_type:
last_in_pos += canvas.theme.port_spacingT last_in_pos += canvas.theme.port_spacingT


port.widget.setPos(QPointF(1 + canvas.theme.port_offset, last_in_pos))
port.widget.setPos(QPointF(canvas.theme.port_offset, last_in_pos))
port.widget.setPortWidth(max_in_width) port.widget.setPortWidth(max_in_width)


last_in_pos += port_spacing last_in_pos += port_spacing
@@ -2302,7 +2302,7 @@ class CanvasBox(QGraphicsItem):
if last_out_type != PORT_TYPE_NULL and port.port_type != last_out_type: if last_out_type != PORT_TYPE_NULL and port.port_type != last_out_type:
last_out_pos += canvas.theme.port_spacingT last_out_pos += canvas.theme.port_spacingT


port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 13, last_out_pos))
port.widget.setPos(QPointF(self.p_width - max_out_width - canvas.theme.port_offset - 12, last_out_pos))
port.widget.setPortWidth(max_out_width) port.widget.setPortWidth(max_out_width)


last_out_pos += port_spacing last_out_pos += port_spacing


+ 2
- 2
src/patchcanvas_theme.py View File

@@ -359,7 +359,7 @@ class Theme(object):
self.port_midi_alsa_text_sel = self.port_text self.port_midi_alsa_text_sel = self.port_text


self.port_height = 14 self.port_height = 14
self.port_offset = -1
self.port_offset = 0
self.port_spacing = 1 self.port_spacing = 1
self.port_spacingT = 0 self.port_spacingT = 0


@@ -446,7 +446,7 @@ class Theme(object):


# missing, ports 2 # missing, ports 2
self.port_height = 19 self.port_height = 19
self.port_offset = -1
self.port_offset = 0
self.port_spacing = 5 self.port_spacing = 5
self.port_spacingT = 0 self.port_spacingT = 0




Loading…
Cancel
Save