Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
码匠许师傅
rt-thread
提交
df3262f0
R
rt-thread
项目概览
码匠许师傅
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
df3262f0
编写于
9月 05, 2018
作者:
W
weety
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Beautify the configuration interface and keep the interface style consistent with the c tool.
上级
0f40dd6a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
1 deletion
+16
-1
tools/pymenuconfig.py
tools/pymenuconfig.py
+16
-1
未找到文件。
tools/pymenuconfig.py
浏览文件 @
df3262f0
...
...
@@ -585,10 +585,12 @@ class MenuConfig(object):
self
.
list
=
tk
.
Listbox
(
dlg
,
selectmode
=
tk
.
SINGLE
,
activestyle
=
tk
.
UNDERLI
NE
,
activestyle
=
tk
.
NO
NE
,
font
=
font
.
nametofont
(
'TkFixedFont'
),
height
=
1
,
)
self
.
list
[
'foreground'
]
=
'Blue'
self
.
list
[
'background'
]
=
'Gray95'
# Make selection invisible
self
.
list
[
'selectbackground'
]
=
self
.
list
[
'background'
]
self
.
list
[
'selectforeground'
]
=
self
.
list
[
'foreground'
]
...
...
@@ -633,6 +635,8 @@ class MenuConfig(object):
dlg
.
bind
(
'<Return>'
,
self
.
handle_keypress
)
dlg
.
bind
(
'<Right>'
,
self
.
handle_keypress
)
dlg
.
bind
(
'<Left>'
,
self
.
handle_keypress
)
dlg
.
bind
(
'<Up>'
,
self
.
handle_keypress
)
dlg
.
bind
(
'<Down>'
,
self
.
handle_keypress
)
dlg
.
bind
(
'n'
,
self
.
handle_keypress
)
dlg
.
bind
(
'm'
,
self
.
handle_keypress
)
dlg
.
bind
(
'y'
,
self
.
handle_keypress
)
...
...
@@ -655,6 +659,10 @@ class MenuConfig(object):
for
n
,
c
in
widget
.
children
.
items
():
self
.
_set_option_to_all_children
(
c
,
option
,
value
)
def
_invert_colors
(
self
,
idx
):
self
.
list
.
itemconfig
(
idx
,
{
'bg'
:
self
.
list
[
'foreground'
]})
self
.
list
.
itemconfig
(
idx
,
{
'fg'
:
self
.
list
[
'background'
]})
@
property
def
_selected_entry
(
self
):
# type: (...) -> ListEntry
...
...
@@ -676,6 +684,7 @@ class MenuConfig(object):
if
idx
is
not
None
:
self
.
list
.
activate
(
idx
)
self
.
list
.
see
(
idx
)
self
.
_invert_colors
(
idx
)
def
handle_keypress
(
self
,
ev
):
keysym
=
ev
.
keysym
...
...
@@ -683,6 +692,10 @@ class MenuConfig(object):
self
.
_select_action
(
prev
=
True
)
elif
keysym
==
'Right'
:
self
.
_select_action
(
prev
=
False
)
elif
keysym
==
'Up'
:
self
.
refresh_display
(
reset_selection
=
False
)
elif
keysym
==
'Down'
:
self
.
refresh_display
(
reset_selection
=
False
)
elif
keysym
==
'space'
:
self
.
_selected_entry
.
toggle
()
elif
keysym
in
(
'n'
,
'm'
,
'y'
):
...
...
@@ -777,6 +790,7 @@ class MenuConfig(object):
else
:
# Select the topmost entry
self
.
list
.
activate
(
0
)
self
.
_invert_colors
(
0
)
# Select ACTION_SELECT on each refresh (mimic C menuconfig)
self
.
tk_selected_action
.
set
(
self
.
ACTION_SELECT
)
# Display current location in configuration tree
...
...
@@ -804,6 +818,7 @@ class MenuConfig(object):
self
.
show_node
(
parent_node
)
# Restore previous selection
self
.
_select_node
(
select_node
)
self
.
refresh_display
(
reset_selection
=
False
)
def
ask_for_string
(
self
,
ident
=
None
,
title
=
'Enter string'
,
value
=
None
):
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录