Skip to content

Commit

Permalink
0.11.45,优化终端滚动机制
Browse files Browse the repository at this point in the history
  • Loading branch information
MetaLe0 committed Aug 4, 2024
1 parent f938cfc commit 367a17b
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 24 deletions.
6 changes: 3 additions & 3 deletions OlivOS/core/info/infoAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import OlivOS


OlivOS_Version = '0.11.44'
OlivOS_SVN = 164
OlivOS_Version_Slogan = '大薯条'
OlivOS_Version = '0.11.45'
OlivOS_SVN = 165
OlivOS_Version_Slogan = '立秋'

# Compatible <= Plugin[compatible_svn] : Compatible
# OldCompatible <= Plugin[compatible_svn] < Compatible : OldCompatible Warn
Expand Down
119 changes: 98 additions & 21 deletions OlivOS/nativeGUI/nativeWinUIAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,9 @@ def start(self):
ipadx=0,
ipady=0
)
self.UIData['flag_tree_is_bottom'] = True
self.UIObject['tree'].configure(
yscrollcommand=self.UIObject['tree_yscroll'].set
yscrollcommand=self.scroll_onChange(self.UIObject['tree_yscroll'].set)
)

self.root_Entry_init(
Expand Down Expand Up @@ -1202,6 +1203,15 @@ def start(self):

self.exit()

def scroll_onChange(self, command):
def res(*arg, **kwarg):
if arg[1] == '1.0':
self.UIData['flag_tree_is_bottom'] = True
else:
self.UIData['flag_tree_is_bottom'] = False
return command(*arg, **kwarg)
return res

def tree_rightKey(self, event):
# 右键设置的选择在后续流程中未生效,不知为何,等后续解决
# iid = self.UIObject['tree'].identify_row(event.y)
Expand Down Expand Up @@ -1333,8 +1343,9 @@ def tree_add_line(self, data, flagInit = False):
res_data
)
)
self.UIObject['tree'].see(iid)
self.UIObject['tree'].update()
if self.UIData['flag_tree_is_bottom']:
self.UIObject['tree'].see(iid)
#self.UIObject['tree'].update()
except:
pass

Expand Down Expand Up @@ -1454,8 +1465,9 @@ def start(self):
ipadx=0,
ipady=0
)
self.UIData['flag_tree_is_bottom'] = True
self.UIObject['tree'].configure(
yscrollcommand=self.UIObject['tree_yscroll'].set
yscrollcommand=self.scroll_onChange(self.UIObject['tree_yscroll'].set)
)

self.root_Entry_init(
Expand Down Expand Up @@ -1491,6 +1503,15 @@ def start(self):

self.exit()

def scroll_onChange(self, command):
def res(*arg, **kwarg):
if arg[1] == '1.0':
self.UIData['flag_tree_is_bottom'] = True
else:
self.UIData['flag_tree_is_bottom'] = False
return command(*arg, **kwarg)
return res

def tree_rightKey(self, event):
# 右键设置的选择在后续流程中未生效,不知为何,等后续解决
# iid = self.UIObject['tree'].identify_row(event.y)
Expand Down Expand Up @@ -1595,8 +1616,9 @@ def tree_add_line(self, data, flagInit = False):
res_data
)
)
self.UIObject['tree'].see(iid)
self.UIObject['tree'].update()
if self.UIData['flag_tree_is_bottom']:
self.UIObject['tree'].see(iid)
#self.UIObject['tree'].update()
except:
pass

Expand Down Expand Up @@ -1697,8 +1719,9 @@ def start(self):
ipadx=0,
ipady=0
)
self.UIData['flag_tree_is_bottom'] = True
self.UIObject['tree'].configure(
yscrollcommand=self.UIObject['tree_yscroll'].set
yscrollcommand=self.scroll_onChange(self.UIObject['tree_yscroll'].set)
)

self.root_Entry_init(
Expand Down Expand Up @@ -1734,6 +1757,15 @@ def start(self):

self.exit()

def scroll_onChange(self, command):
def res(*arg, **kwarg):
if arg[1] == '1.0':
self.UIData['flag_tree_is_bottom'] = True
else:
self.UIData['flag_tree_is_bottom'] = False
return command(*arg, **kwarg)
return res

def tree_rightKey(self, event):
# 右键设置的选择在后续流程中未生效,不知为何,等后续解决
# iid = self.UIObject['tree'].identify_row(event.y)
Expand Down Expand Up @@ -1830,8 +1862,9 @@ def tree_add_line(self, data, flagInit = False):
res_data
)
)
self.UIObject['tree'].see(iid)
self.UIObject['tree'].update()
if self.UIData['flag_tree_is_bottom']:
self.UIObject['tree'].see(iid)
#self.UIObject['tree'].update()
except:
pass

Expand Down Expand Up @@ -1918,8 +1951,9 @@ def start(self):
ipadx=0,
ipady=0
)
self.UIData['flag_tree_is_bottom'] = True
self.UIObject['tree'].configure(
yscrollcommand=self.UIObject['tree_yscroll'].set
yscrollcommand=self.scroll_onChange(self.UIObject['tree_yscroll'].set)
)

self.root_Entry_init(
Expand Down Expand Up @@ -1955,6 +1989,15 @@ def start(self):

self.exit()

def scroll_onChange(self, command):
def res(*arg, **kwarg):
if arg[1] == '1.0':
self.UIData['flag_tree_is_bottom'] = True
else:
self.UIData['flag_tree_is_bottom'] = False
return command(*arg, **kwarg)
return res

def tree_rightKey(self, event):
# 右键设置的选择在后续流程中未生效,不知为何,等后续解决
# iid = self.UIObject['tree'].identify_row(event.y)
Expand Down Expand Up @@ -2051,8 +2094,9 @@ def tree_add_line(self, data, flagInit = False):
res_data
)
)
self.UIObject['tree'].see(iid)
self.UIObject['tree'].update()
if self.UIData['flag_tree_is_bottom']:
self.UIObject['tree'].see(iid)
#self.UIObject['tree'].update()
except:
pass

Expand Down Expand Up @@ -2138,8 +2182,9 @@ def start(self):
ipadx=0,
ipady=0
)
self.UIData['flag_tree_is_bottom'] = True
self.UIObject['tree'].configure(
yscrollcommand=self.UIObject['tree_yscroll'].set
yscrollcommand=self.scroll_onChange(self.UIObject['tree_yscroll'].set)
)

self.root_Entry_init(
Expand Down Expand Up @@ -2175,6 +2220,15 @@ def start(self):

self.exit()

def scroll_onChange(self, command):
def res(*arg, **kwarg):
if arg[1] == '1.0':
self.UIData['flag_tree_is_bottom'] = True
else:
self.UIData['flag_tree_is_bottom'] = False
return command(*arg, **kwarg)
return res

def tree_rightKey(self, event):
# 右键设置的选择在后续流程中未生效,不知为何,等后续解决
# iid = self.UIObject['tree'].identify_row(event.y)
Expand Down Expand Up @@ -2271,8 +2325,9 @@ def tree_add_line(self, data, flagInit = False):
res_data
)
)
self.UIObject['tree'].see(iid)
self.UIObject['tree'].update()
if self.UIData['flag_tree_is_bottom']:
self.UIObject['tree'].see(iid)
#self.UIObject['tree'].update()
except:
pass

Expand Down Expand Up @@ -2372,8 +2427,9 @@ def start(self):
ipadx=0,
ipady=0
)
self.UIData['flag_tree_is_bottom'] = True
self.UIObject['tree'].configure(
yscrollcommand=self.UIObject['tree_yscroll'].set
yscrollcommand=self.scroll_onChange(self.UIObject['tree_yscroll'].set)
)

self.tree_edit_UI_Combobox_init(
Expand Down Expand Up @@ -2442,6 +2498,15 @@ def start(self):

self.exit()

def scroll_onChange(self, command):
def res(*arg, **kwarg):
if arg[1] == '1.0':
self.UIData['flag_tree_is_bottom'] = True
else:
self.UIData['flag_tree_is_bottom'] = False
return command(*arg, **kwarg)
return res

def tree_rightKey(self, event):
# 右键设置的选择在后续流程中未生效,不知为何,等后续解决
# iid = self.UIObject['tree'].identify_row(event.y)
Expand Down Expand Up @@ -2596,8 +2661,9 @@ def tree_add_line(self, data):
),
tag=log_level
)
self.UIObject['tree'].see(iid)
self.UIObject['tree'].update()
if self.UIData['flag_tree_is_bottom']:
self.UIObject['tree'].see(iid)
#self.UIObject['tree'].update()
except:
pass

Expand Down Expand Up @@ -3027,8 +3093,9 @@ def start(self):
ipadx=0,
ipady=0
)
self.UIData['flag_tree_is_bottom'] = True
self.UIObject['tree'].configure(
yscrollcommand=self.UIObject['tree_yscroll'].set
yscrollcommand=self.scroll_onChange(self.UIObject['tree_yscroll'].set)
)

self.root_Entry_init(
Expand Down Expand Up @@ -3065,6 +3132,15 @@ def start(self):

self.exit()

def scroll_onChange(self, command):
def res(*arg, **kwarg):
if arg[1] == '1.0':
self.UIData['flag_tree_is_bottom'] = True
else:
self.UIData['flag_tree_is_bottom'] = False
return command(*arg, **kwarg)
return res

def tree_rightKey(self, event):
self.UIObject['tree_rightkey_menu'].delete(0, tkinter.END)
self.UIObject['tree_rightkey_menu'].add_command(label='查看', command=lambda: self.rightKey_action('show'))
Expand Down Expand Up @@ -3176,8 +3252,9 @@ def tree_add_line(self, data, user_conf=None):
res_data_list_this
)
)
self.UIObject['tree'].see(iid)
self.UIObject['tree'].update()
if self.UIData['flag_tree_is_bottom']:
self.UIObject['tree'].see(iid)
#self.UIObject['tree'].update()
except:
pass

Expand Down

0 comments on commit 367a17b

Please sign in to comment.