本文整理汇总了Python中Window.changeWindowState方法的典型用法代码示例。如果您正苦于以下问题:Python Window.changeWindowState方法的具体用法?Python Window.changeWindowState怎么用?Python Window.changeWindowState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.changeWindowState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mouseReleaseEvent
# 需要导入模块: import Window [as 别名]
# 或者: from Window import changeWindowState [as 别名]
#.........这里部分代码省略.........
if len(all_stuff)!=apps_per_row:
row_num = math.trunc(len(all_stuff)/apps_per_row)+1
else:
row_num = math.trunc(len(all_stuff)/apps_per_row)
h=int(self.conf["icon-size"])*all_rows+i*50
all_rows+=row_num
for j, thing in enumerate(all_stuff):
row_pos = math.trunc(j/apps_per_row)
x_pos = int(self.conf["icon-size"])*(j-(row_pos*apps_per_row))+40
y_pos = (row_pos*int(self.conf["icon-size"])+20)+h+30
if x_pos-10<x_m<x_pos-10+int(self.conf["icon-size"]) and y_pos<y_m<y_pos+int(self.conf["icon-size"]) and x_m<self.pos_x-self.SIZE-3:
if e.button()==QtCore.Qt.LeftButton:
if thing['type']=='app':
the_exec=""
for a in Apps.info(''):
if thing['value'] in a['name']:
the_exec=a['exec']
thread = Widgets.Launch(parent=self)
thread.app=the_exec
thread.start()
print("[Duck Launcher] Launching '{0}' with '{1}'".format(thing["value"], the_exec) )
else:
import webbrowser
webbrowser.open(thing['value'])
elif self.current_state=="half_open":
##buttonsszd
if 0<x_m<self.HALF_OPEN_POS:
if e.button()==QtCore.Qt.LeftButton:
if y_m<self.ICO_TOP:
self.activity="apps"
self.current_text=''
self.open_it()
#self.allApps=Apps.info(self.current_text)
if self.ICO_TOP<y_m<self.ICO_TOP*2:
HOME=os.path.expanduser("~")
self.activity="apps"
self.current_text="#Files "
pl= Plugins.get(str(self.current_text))
html=pl.html(color=(self.conf["r"],self.conf["g"],self.conf["b"]),font=self.conf["font"])
if html!=None:
self.open_it()
self.plugin=True
self.pl_logo="/usr/share/duck-launcher/default-theme/file.svg"
self.fg_color=(40,40,40)
self.font_color=(255,255,255)
self.open_pl_rect()
self.webview.setHtml(html)
self.webview.show()
#self.webview.page().mainFrame().setFocus()
#self.webview.setFocus()
self.update()
if self.ICO_TOP*2<y_m<self.ICO_TOP*3:
self.activity="settings"
Settings(parent=self).start()
if self.ICO_TOP*3<y_m<self.ICO_TOP*4:
self.activity="star"
self.open_it()
if self.s_height-self.HALF_OPEN_POS-5<y_m:
if self.sys_win.isHidden():
#self.open_win.close()
self.sys_win.show()
elif self.sys_win.isHidden()==False:
self.sys_win.close()
for i,a in enumerate(self.dock_apps):
if self.OPEN_STATE_TOP+self.ICO_TOP*i+10<y_m<self.OPEN_STATE_TOP+self.ICO_TOP*(i+1)+10:
if e.button()==QtCore.Qt.LeftButton:
if a["name"] in [e["name"] for e in self.ow_in_dock]:
l=[e for e in self.ow_in_dock if e["name"]==a["name"]]
for k in l:
c = Window.changeWindowState(parent=self,win_info=k["info"])
c.start()
else:
print("[Duck Launcher] Launching '{0}' with '{1}'".format(a["name"], a["exec"]) )
thread = Widgets.Launch(parent=self)
thread.app=a["exec"]
thread.start()
self.dock_options_win.close()
elif e.button()==QtCore.Qt.RightButton:
#LaunchOption(y_pos, app_dict
if self.dock_options_win.isHidden() or self.dock_options_win.app["name"]!=a["name"]:
self.dock_options_win.update_all(self.conf)
self.dock_options_win.setTopPosition(self.OPEN_STATE_TOP+self.ICO_TOP*i+10)
self.dock_options_win.setApp(a)
self.dock_options_win.updateWidth()
self.dock_options_win.show()
else:
self.dock_options_win.close()
if len(self.open_windows)>0:
after_dapps = self.OPEN_STATE_TOP+len(self.dock_apps)*self.ICO_TOP+30
all_wins=[e["info"]["id"] for e in self.ow_in_dock]
ow_list=[o for o in self.open_windows if o["id"] not in all_wins]
for i,w in enumerate(ow_list):
y_pos=i*self.ICO_TOP+after_dapps-3
if y_pos<y_m<y_pos+self.ICO_TOP:
c = Window.changeWindowState(parent=self,win_info=w)
c.start()
self.update()