本文整理汇总了Python中ubuntui.utils.Color.button_secondary方法的典型用法代码示例。如果您正苦于以下问题:Python Color.button_secondary方法的具体用法?Python Color.button_secondary怎么用?Python Color.button_secondary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntui.utils.Color
的用法示例。
在下文中一共展示了Color.button_secondary方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: buttons
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def buttons(self):
cancel = cancel_btn(on_press=self.cancel)
buttons = [
Color.button_secondary(cancel, focus_map='button_secondary focus')
]
return Pile(buttons)
示例2: build_widgets
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def build_widgets(self, maxlen):
num_str = "{}".format(self.application.num_units)
col_pad = 6
self.unit_w = Text('Units: {:4d}'.format(self.application.num_units),
align='right')
cws = [
(maxlen + col_pad,
Text(self.application.service_name)),
(10 + len(num_str), self.unit_w),
# placeholder for instance type
('weight', 1, Text(" ")),
# placeholder for configure button
('weight', 1, Text(" ")),
(20, Color.button_primary(
PlainButton("Deploy",
partial(self.deploy_cb,
self.application)),
focus_map='button_primary focus'))
]
if not self.hide_config:
cws[3] = (20, Color.button_secondary(
PlainButton("Configure",
partial(self.controller.do_configure,
self.application)),
focus_map='button_secondary focus'))
self.columns = Columns(cws, dividechars=1)
return self.columns
示例3: _build_buttons
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def _build_buttons(self):
buttons = [
Color.button_secondary(
cancel_btn(label="Quit", on_press=self.cancel),
focus_map="button_secondary focus")
]
return Pile(buttons)
示例4: _build_buttons
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def _build_buttons(self):
cancel = quit_btn(on_press=self.cancel)
buttons = [
Padding.line_break(""),
Color.button_secondary(cancel,
focus_map='button_secondary focus'),
]
return Pile(buttons)
示例5: buttons
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def buttons(self):
confirm = confirm_btn(on_press=self.submit, label="Add credential")
cancel = back_btn(on_press=self.cancel)
buttons = [
Color.button_primary(confirm, focus_map='button_primary focus'),
Color.button_secondary(cancel, focus_map='button_secondary focus')
]
return Pile(buttons)
示例6: buttons
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def buttons(self):
confirm = confirm_btn(on_press=self.submit)
cancel = cancel_btn(on_press=self.cancel)
buttons = [
Color.button_primary(confirm, focus_map='button_primary focus'),
Color.button_secondary(cancel, focus_map='button_secondary focus')
]
return Pile(buttons)
示例7: _build_buttons
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def _build_buttons(self):
buttons = [
Color.button_primary(
Button("Confirm", self.submit),
focus_map='button_primary focus'),
Color.button_secondary(
Button("Cancel", self.cancel),
focus_map='button_secondary focus')
]
return Pile(buttons)
示例8: build_widgets
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def build_widgets(self):
self.description_w = Text("Description Loading…")
self.readme_w = Text("README Loading…")
self.scale_edit = IntegerEditor(default=self.service.num_units)
connect_signal(self.scale_edit._edit, 'change',
self.handle_scale_changed)
self.skip_rest_button = PlainButton(
"Deploy all {} Remaining Applications with Bundle Defaults".format(
self.n_remaining),
self.do_skip_rest
)
col = Columns(
[
(6, Text('Units:', align='right')),
(15,
Color.string_input(self.scale_edit,
focus_map='string_input focus'))
], dividechars=1
)
if self.n_remaining == 0:
buttons = [Padding.right_50(Color.button_primary(
PlainButton("Deploy and Continue",
self.do_deploy),
focus_map='button_primary focus'))]
else:
buttons = [
Padding.right_50(Color.button_primary(
PlainButton(
"Deploy and Configure Next Application",
self.do_deploy),
focus_map='button_primary focus')),
Padding.right_50(
Color.button_secondary(
self.skip_rest_button,
focus_map='button_secondary focus'))]
ws = [Text("{} of {}: {}".format(self.idx+1, self.n_total,
self.service.service_name.upper())),
Padding.center(HR()),
Padding.center(self.description_w, left=2),
Padding.line_break(""),
Padding.center(self.readme_w, left=2),
Padding.center(HR())]
if not self.service.subordinate:
ws.append(Padding.left(col, left=1))
ws.append(Padding.line_break(""))
ws += buttons
self.pile = Pile(ws)
return Padding.center_90(Filler(self.pile, valign="top"))
示例9: build_widgets
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def build_widgets(self):
desc_text = Text(["\n", strip_solo_dots(self.description)])
self.reset_button = PlainButton("Reset to Default", self.do_reset)
if self.optype == OptionType.BOOLEAN:
self.control = CheckBox('', state=bool(self.current_value))
self.wrapped_control = self.control
elif self.optype == OptionType.INT:
self.control = IntEdit(default=self.current_value)
self.wrapped_control = Color.string_input(
self.control, focus_map='string_input focus')
elif self.optype == OptionType.STRING:
edit_text = self.current_value or ""
self.control = StringEditor(edit_text=edit_text)
self.wrapped_control = Color.string_input(
self.control, focus_map='string_input focus')
elif self.optype == OptionType.FLOAT:
edit_text = str(self.current_value)
self.control = StringEditor(edit_text=edit_text)
self.wrapped_control = Color.string_input(
self.control, focus_map='string_input focus')
else:
raise Exception("Unknown option type")
self.control_columns = Columns(
[
('pack', Text("{}:".format(self.name), align='right')),
(80, self.wrapped_control)
],
dividechars=1
)
if self.optype in [OptionType.STRING, OptionType.FLOAT]:
connect_signal(self.control._edit, 'change',
self.handle_value_changed)
else:
connect_signal(self.control, 'change',
self.handle_value_changed)
button_grid = GridFlow([
Color.button_secondary(self.reset_button,
focus_map='button_secondary focus')],
36, 1, 0, 'right')
return Pile([Padding.line_break(""),
Padding.left(self.control_columns, left=1),
Padding.left(desc_text, left=2),
button_grid])
示例10: build_widgets
# 需要导入模块: from ubuntui.utils import Color [as 别名]
# 或者: from ubuntui.utils.Color import button_secondary [as 别名]
def build_widgets(self):
ws = [Text("Configure {}".format(
self.application.service_name))]
num_unit_ow = OptionWidget("Units", "int",
"How many units to deploy.",
self.application.orig_num_units,
current_value=self.application.num_units,
value_changed_callback=self.handle_scale)
ws.append(num_unit_ow)
ws += self.get_whitelisted_option_widgets()
self.toggle_show_all_button_index = len(ws) + 1
self.toggle_show_all_button = PlainButton(
"Show Advanced Configuration",
self.do_toggle_show_all_config)
ws += [HR(),
Columns([('weight', 1, Text(" ")),
(36, Color.button_secondary(
self.toggle_show_all_button))])]
self.pile = Pile(ws)
return Padding.center_90(Filler(self.pile, valign="top"))