Skip to content

Commit

Permalink
add config for osdlyrics background area size
Browse files Browse the repository at this point in the history
  • Loading branch information
chih7 committed Mar 17, 2017
1 parent 4048068 commit da963ee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion NEMbox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self):
self._init = True
self.config_file_path = Constant.config_path
self.default_config = {
'version': 7,
'version': 8,
'cache': {
'value': False,
'default': False,
Expand Down Expand Up @@ -94,6 +94,11 @@ def __init__(self):
'default': [225, 248, 113],
'describe': 'Desktop lyrics RGB Color.'
},
'osdlyrics_size': {
'value': [600, 60],
'default': [600, 60],
'describe': 'Desktop lyrics area size.'
},
'osdlyrics_font': {
'value': ['Decorative', 16],
'default': ['Decorative', 16],
Expand Down Expand Up @@ -224,6 +229,13 @@ def check_version(self):
'default': False,
'describe': 'Set true to make curses transparency.'
}
elif self.config['version'] == 7:
self.config['version'] = 8
self.config['osdlyrics_size'] = {
'value': [600, 60],
'default': [600, 60],
'describe': 'Desktop lyrics area size.'
}
self.check_version()
return False

Expand Down
3 changes: 2 additions & 1 deletion NEMbox/osdlyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def initUI(self):
else:
self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
self.setMinimumSize(600, 50)
self.resize(600, 60)
osdlyrics_size = config.get_item("osdlyrics_size")
self.resize(osdlyrics_size[0], osdlyrics_size[1])
scn = QtGui.QApplication.desktop().screenNumber(
QtGui.QApplication.desktop().cursor().pos())
bl = QtGui.QApplication.desktop().screenGeometry(scn).bottomLeft()
Expand Down

0 comments on commit da963ee

Please sign in to comment.