diff options
author | Jesús Eduardo <heckyel@hyperbola.info> | 2017-08-17 20:13:25 -0500 |
---|---|---|
committer | Jesús Eduardo <heckyel@hyperbola.info> | 2017-08-17 20:13:25 -0500 |
commit | 6e5d4a36239d3366551c9055edc5450029266542 (patch) | |
tree | 4eaf7eef9bcea247d131fd041c3905736c157a5e /mvc/ui/widgets.py | |
parent | 4c6485c48dc886daf6161af78064adfb64710b77 (diff) | |
download | librevideoconverter-6e5d4a36239d3366551c9055edc5450029266542.tar.lz librevideoconverter-6e5d4a36239d3366551c9055edc5450029266542.tar.xz librevideoconverter-6e5d4a36239d3366551c9055edc5450029266542.zip |
widgets.py: fixed indetation
Diffstat (limited to 'mvc/ui/widgets.py')
-rw-r--r-- | mvc/ui/widgets.py | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/mvc/ui/widgets.py b/mvc/ui/widgets.py index 67dffc8..1980a88 100644 --- a/mvc/ui/widgets.py +++ b/mvc/ui/widgets.py @@ -271,25 +271,25 @@ class SettingsButton(widgetset.CustomButton): image_path('%s-icon-off.png' % name))) if self.surface_on.height != self.surface_off.height: raise ValueError('invalid surface: height mismatch') - self.image_padding = self.calc_image_padding(name) + self.image_padding = self.calc_image_padding(name) else: self.surface_on = self.surface_off = None def calc_image_padding(self, name): - """Add some padding to the bottom of our image icon. This can be used - to fine tune where it gets placed. + """Add some padding to the bottom of our image icon. This can be used + to fine tune where it gets placed. - :returns: padding in as a (top, right, bottom, left) tuple - """ + :returns: padding in as a (top, right, bottom, left) tuple + """ - # NOTE: we vertically center the images, so in order to move it X - # pickels up, we need X*2 pixels of bottom padding - if name == 'android': - return (0, 0, 2, 0) - elif name in ('apple', 'other'): - return (0, 0, 4, 0) - else: - return (0, 0, 0, 0) + # NOTE: we vertically center the images, so in order to move it X + # pickels up, we need X*2 pixels of bottom padding + if name == 'android': + return (0, 0, 2, 0) + elif name in ('apple', 'other'): + return (0, 0, 4, 0) + else: + return (0, 0, 0, 0) def textbox(self, layout_manager): layout_manager.set_font(SETTINGS_FONTSIZE, family=SETTINGS_FONT) @@ -312,7 +312,7 @@ class SettingsButton(widgetset.CustomButton): arrow = self.arrow_off layout_manager.set_text_color(TEXT_DISABLED) if image: - padding = cellpack.Padding(image, *self.image_padding) + padding = cellpack.Padding(image, *self.image_padding) hbox.pack(cellpack.Alignment(padding, xscale=0, yscale=0, yalign=0.5)) if self.name: @@ -435,19 +435,19 @@ class CustomOptions(widgetset.Background): def create_top(self): hbox = widgetset.HBox(spacing=0) - path_label = WebStyleButton() - path_label.set_text('Show output folder') + path_label = WebStyleButton() + path_label.set_text('Show output folder') path_label.set_font(DEFAULT_FONT, widgetconst.SIZE_SMALL) path_label.connect('clicked', self.on_path_label_clicked) create_thumbnails = widgetset.Checkbox('Create Thumbnails', - color=TEXT_COLOR) + color=TEXT_COLOR) create_thumbnails.set_size(widgetconst.SIZE_SMALL) create_thumbnails.connect('toggled', - self.on_create_thumbnails_changed) + self.on_create_thumbnails_changed) hbox.pack_start(widgetutil.align(path_label, xalign=0.5), expand=True) hbox.pack_start(widgetutil.align(create_thumbnails, xalign=0.5), - expand=True) + expand=True) # XXX: disabled until we can figure out how to do this properly. #button = widgetset.Button('...') #button.connect('clicked', self.on_destination_clicked) @@ -458,15 +458,15 @@ class CustomOptions(widgetset.Background): return widgetutil.align(hbox, xscale=1.0, yalign=0.5) def _get_save_to_path(self): - if self.options['destination'] is None: - return get_conversion_directory() - else: - return self.options['destination'] + if self.options['destination'] is None: + return get_conversion_directory() + else: + return self.options['destination'] def on_path_label_clicked(self, label): save_path = self._get_save_to_path() save_path = convert_path_for_subprocess(save_path) - openfiles.reveal_folder(save_path) + openfiles.reveal_folder(save_path) def create_left(self): self.custom_size = widgetset.Checkbox('Custom Size', color=TEXT_COLOR) @@ -510,7 +510,7 @@ class CustomOptions(widgetset.Background): b1 = widgetset.RadioButton('4:3', self.button_group, color=TEXT_COLOR) b2 = widgetset.RadioButton('3:2', self.button_group, color=TEXT_COLOR) b3 = widgetset.RadioButton('16:9', self.button_group, color=TEXT_COLOR) - b1.set_selected() + b1.set_selected() b1.set_size(widgetconst.SIZE_SMALL) b2.set_size(widgetconst.SIZE_SMALL) b3.set_size(widgetconst.SIZE_SMALL) @@ -814,13 +814,13 @@ class ConversionCellRenderer(widgetset.CustomCellRenderer): @staticmethod def draw_background(context, x, y, width, height): - # draw main background + # draw main background gradient = widgetset.Gradient(x, y, x, height) gradient.set_start_color(GRADIENT_TOP) gradient.set_end_color(GRADIENT_BOTTOM) context.rectangle(x, y, width, height) context.gradient_fill(gradient) - # draw bottom line + # draw bottom line context.set_line_width(1) context.set_color((0, 0, 0)) context.move_to(0, height-0.5) @@ -1020,9 +1020,9 @@ class TextDialog(widgetset.Dialog): class Application(mvc.Application): def __init__(self, simultaneous=None): - mvc.Application.__init__(self, simultaneous) - self.create_signal('window-shown') - self.sent_window_shown = False + mvc.Application.__init__(self, simultaneous) + self.create_signal('window-shown') + self.sent_window_shown = False def startup(self): if self.started: @@ -1119,9 +1119,9 @@ class Application(mvc.Application): vbox = widgetset.VBox() self.vbox = vbox - # add menubars, if we're not on windows - if sys.platform != 'win32': - attach_menubar() + # add menubars, if we're not on windows + if sys.platform != 'win32': + attach_menubar() self.scroller = widgetset.Scroller(False, True) self.scroller.set_size_request(0, 0) @@ -1194,11 +1194,11 @@ class Application(mvc.Application): self.file_activated(widget, pathname) def on_window_shown(self, window): - # only emit window-shown once, even if our window gets shown, hidden, - # and shown again - if not self.sent_window_shown: - self.emit("window-shown") - self.sent_window_shown = True + # only emit window-shown once, even if our window gets shown, hidden, + # and shown again + if not self.sent_window_shown: + self.emit("window-shown") + self.sent_window_shown = True def destroy(self, widget): for conversion in self.conversion_manager.in_progress.copy(): @@ -1502,7 +1502,7 @@ class Application(mvc.Application): return if (self.current_converter.identifier != 'custom' and - setting != 'create-thumbnails'): + setting != 'create-thumbnails'): if hasattr(self.current_converter, 'simple'): self.current_converter = self.current_converter.simple( self.current_converter.name) @@ -1531,8 +1531,8 @@ class Application(mvc.Application): old_size = self.current_converter.old_size (self.current_converter.width, self.current_converter.height) = old_size - elif setting == 'create-thumbnails': - self.conversion_manager.create_thumbnails = bool(value) + elif setting == 'create-thumbnails': + self.conversion_manager.create_thumbnails = bool(value) if __name__ == "__main__": sys.dont_write_bytecode = True |