X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=scripts%2Fmotion.py;h=e0a1d3522fbe6c3e1cb9f55136157f1e272e79fc;hb=4ef15148365c223b8e810611a10dc27dc5fba355;hp=c32c1e62a7fe86c014253a5c6af6a030ebef1432;hpb=69d12b5ee2e8da238ac2fca5606cc25ddaa07523;p=chaz%2Fopenbox diff --git a/scripts/motion.py b/scripts/motion.py index c32c1e62..e0a1d352 100644 --- a/scripts/motion.py +++ b/scripts/motion.py @@ -97,8 +97,8 @@ def _do_move(): global _screen, _client, _cx, _cy, _dx, _dy # get destination x/y for the *frame* - x = _cx + _dx + _client.frame.rect().x() - _client.area().x() - y = _cy + _dy + _client.frame.rect().y() - _client.area().y() + x = _cx + _dx + _client.frame.area().x() - _client.area().x() + y = _cy + _dy + _client.frame.area().y() - _client.area().y() global _last_x, _last_y if EDGE_RESISTANCE: @@ -106,7 +106,7 @@ def _do_move(): w = _client.area().width() + fs.left + fs.right h = _client.area().height() + fs.top + fs.bottom # use the area based on the struts - area = ob.openbox.screen(_screen).area() + area = ob.openbox.screen(_screen).area(_client.desktop()) l = area.left() r = area.right() - w + 1 t = area.top() @@ -140,25 +140,18 @@ def _do_move(): if MOVE_POPUP: global _popwidget, _poplabel - style = ob.openbox.screen(_screen).style() - font = style.labelFont() text = "X: " + str(x) + " Y: " + str(y) - length = font.measureString(text) if not _popwidget: - _popwidget = otk.Widget(ob.openbox, style, - otk.Widget.Horizontal, 0, - style.bevelWidth(), 1) - _popwidget.setTexture(style.titlebarFocusBackground()) - _poplabel = otk.FocusLabel(_popwidget) - _poplabel.focus() - _poplabel.fitString(text) + _popwidget = otk.Widget(_screen, ob.openbox, + otk.Widget.Horizontal, 0, 1) + _poplabel = otk.Label(_popwidget) + _poplabel.setHighlighted(1) _poplabel.setText(text) - _popwidget.update() - area = otk.display.screenInfo(_screen).rect() - _popwidget.move(area.x() + (area.width() - - _popwidget.width()) / 2, - area.y() + (area.height() - - _popwidget.height()) / 2) + scsize = otk.display.screenInfo(_screen).size() + size = _poplabel.minSize() + _popwidget.moveresize(otk.Rect((scsize.width() - size.width()) / 2, + (scsize.height() - size.height()) / 2, + size.width(), size.height())) _popwidget.show(1) def _move(data): @@ -230,24 +223,19 @@ def _do_resize(): if RESIZE_POPUP: global _popwidget, _poplabel - style = ob.openbox.screen(_screen).style() ls = _client.logicalSize() - text = "W: " + str(ls.x()) + " H: " + str(ls.y()) + text = "W: " + str(ls.width()) + " H: " + str(ls.height()) if not _popwidget: - _popwidget = otk.Widget(ob.openbox, style, - otk.Widget.Horizontal, 0, - style.bevelWidth(), 1) - _popwidget.setTexture(style.titlebarFocusBackground()) - _poplabel = otk.FocusLabel(_popwidget) - _poplabel.focus() - _poplabel.fitString(text) + _popwidget = otk.Widget(_screen, ob.openbox, + otk.Widget.Horizontal, 0, 1) + _poplabel = otk.Label(_popwidget) + _poplabel.setHighlighted(1) _poplabel.setText(text) - area = otk.display.screenInfo(_screen).rect() - _popwidget.update() - _popwidget.move(area.x() + (area.width() - - _popwidget.width()) / 2, - area.y() + (area.height() - - _popwidget.height()) / 2) + scsize = otk.display.screenInfo(_screen).size() + size = _poplabel.minSize() + _popwidget.moveresize(otk.Rect((scsize.width() - size.width()) / 2, + (scsize.height() - size.height()) / 2, + size.width(), size.height())) _popwidget.show(1) def _resize(data):