some updatesto match changes to otk. Many more needed..
This commit is contained in:
parent
5adb8c82d1
commit
1c97e9fb7b
1 changed files with 21 additions and 33 deletions
|
@ -97,8 +97,8 @@ def _do_move():
|
||||||
global _screen, _client, _cx, _cy, _dx, _dy
|
global _screen, _client, _cx, _cy, _dx, _dy
|
||||||
|
|
||||||
# get destination x/y for the *frame*
|
# get destination x/y for the *frame*
|
||||||
x = _cx + _dx + _client.frame.rect().x() - _client.area().x()
|
x = _cx + _dx + _client.frame.area().x() - _client.area().x()
|
||||||
y = _cy + _dy + _client.frame.rect().y() - _client.area().y()
|
y = _cy + _dy + _client.frame.area().y() - _client.area().y()
|
||||||
|
|
||||||
global _last_x, _last_y
|
global _last_x, _last_y
|
||||||
if EDGE_RESISTANCE:
|
if EDGE_RESISTANCE:
|
||||||
|
@ -140,25 +140,17 @@ def _do_move():
|
||||||
|
|
||||||
if MOVE_POPUP:
|
if MOVE_POPUP:
|
||||||
global _popwidget, _poplabel
|
global _popwidget, _poplabel
|
||||||
style = ob.openbox.screen(_screen).style()
|
|
||||||
font = style.labelFont()
|
|
||||||
text = "X: " + str(x) + " Y: " + str(y)
|
text = "X: " + str(x) + " Y: " + str(y)
|
||||||
length = font.measureString(text)
|
|
||||||
if not _popwidget:
|
if not _popwidget:
|
||||||
_popwidget = otk.Widget(ob.openbox, style,
|
_popwidget = otk.Widget(_screen, ob.openbox,
|
||||||
otk.Widget.Horizontal, 0,
|
otk.Widget.Horizontal, 0, 1)
|
||||||
style.bevelWidth(), 1)
|
_poplabel = otk.Label(_popwidget)
|
||||||
_popwidget.setTexture(style.titlebarFocusBackground())
|
|
||||||
_poplabel = otk.FocusLabel(_popwidget)
|
|
||||||
_poplabel.focus()
|
|
||||||
_poplabel.fitString(text)
|
|
||||||
_poplabel.setText(text)
|
_poplabel.setText(text)
|
||||||
_popwidget.update()
|
scsize = otk.display.screenInfo(_screen).size()
|
||||||
area = otk.display.screenInfo(_screen).rect()
|
size = _poplabel.minSize()
|
||||||
_popwidget.move(area.x() + (area.width() -
|
_popwidget.resize(_poplabel.minSize())
|
||||||
_popwidget.width()) / 2,
|
_popwidget.move(otk.Point((scsize.width() - size.width()) / 2,
|
||||||
area.y() + (area.height() -
|
(scsize.height() - size.height()) / 2))
|
||||||
_popwidget.height()) / 2)
|
|
||||||
_popwidget.show(1)
|
_popwidget.show(1)
|
||||||
|
|
||||||
def _move(data):
|
def _move(data):
|
||||||
|
@ -221,6 +213,8 @@ def _do_resize():
|
||||||
|
|
||||||
w = _cw + dx
|
w = _cw + dx
|
||||||
h = _ch + dy
|
h = _ch + dy
|
||||||
|
if w < 0: w = 0
|
||||||
|
if h < 0: h = 0
|
||||||
|
|
||||||
if RESIZE_RUBBERBAND:
|
if RESIZE_RUBBERBAND:
|
||||||
# draw the outline ...
|
# draw the outline ...
|
||||||
|
@ -230,24 +224,18 @@ def _do_resize():
|
||||||
|
|
||||||
if RESIZE_POPUP:
|
if RESIZE_POPUP:
|
||||||
global _popwidget, _poplabel
|
global _popwidget, _poplabel
|
||||||
style = ob.openbox.screen(_screen).style()
|
|
||||||
ls = _client.logicalSize()
|
ls = _client.logicalSize()
|
||||||
text = "W: " + str(ls.x()) + " H: " + str(ls.y())
|
text = "W: " + str(ls.width()) + " H: " + str(ls.height())
|
||||||
if not _popwidget:
|
if not _popwidget:
|
||||||
_popwidget = otk.Widget(ob.openbox, style,
|
_popwidget = otk.Widget(_screen, ob.openbox,
|
||||||
otk.Widget.Horizontal, 0,
|
otk.Widget.Horizontal, 0, 1)
|
||||||
style.bevelWidth(), 1)
|
_poplabel = otk.Label(_popwidget)
|
||||||
_popwidget.setTexture(style.titlebarFocusBackground())
|
|
||||||
_poplabel = otk.FocusLabel(_popwidget)
|
|
||||||
_poplabel.focus()
|
|
||||||
_poplabel.fitString(text)
|
|
||||||
_poplabel.setText(text)
|
_poplabel.setText(text)
|
||||||
area = otk.display.screenInfo(_screen).rect()
|
scsize = otk.display.screenInfo(_screen).size()
|
||||||
_popwidget.update()
|
size = _poplabel.minSize()
|
||||||
_popwidget.move(area.x() + (area.width() -
|
_popwidget.resize(_poplabel.minSize())
|
||||||
_popwidget.width()) / 2,
|
_popwidget.move(otk.Point((scsize.width() - size.width()) / 2,
|
||||||
area.y() + (area.height() -
|
(scsize.height() - size.height()) / 2))
|
||||||
_popwidget.height()) / 2)
|
|
||||||
_popwidget.show(1)
|
_popwidget.show(1)
|
||||||
|
|
||||||
def _resize(data):
|
def _resize(data):
|
||||||
|
|
Loading…
Reference in a new issue