diff options
author | René Stadler <mail@renestadler.de> | 2009-11-28 00:11:06 +0200 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2009-11-28 00:14:10 +0200 |
commit | 1e24ba320b66fa4ed8548a71cbaa036413a93ea6 (patch) | |
tree | 0c0b2ff73e0534e44697741233e4774559a126f1 | |
parent | f5e616d797e82e2f20c80400eab1990e2591fa1d (diff) |
DetailsPage: Safe-guard GtkLinkButton adjustment hack
This breaks with recent gtk versions, where the button's child widget is None.
-rw-r--r-- | GstInspector/GUI/pages.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/GstInspector/GUI/pages.py b/GstInspector/GUI/pages.py index 08f8f98..3fbea4e 100644 --- a/GstInspector/GUI/pages.py +++ b/GstInspector/GUI/pages.py @@ -114,21 +114,22 @@ class DetailsPage (Page): self.link_button.connect ("clicked", self.handle_link_button_clicked) self.link_button.show () - # Little hack to make the label inside the LinkButton align with all - # the others. The LinkButton has a margin around the label. A shadow - # (border) is drawn there on mouse over only, so it looks totally odd - # without this little adjustment. - button_req_width = self.link_button.size_request ()[0] - child_req_width = self.link_button.child.size_request ()[0] - extra_pad = (button_req_width - child_req_width) / 2 - children = [label] - children += iter_container (self.widgets.element_details_table, - left_attach = 1, right_attach = 2) - children += iter_container (self.widgets.plugin_details_table, - left_attach = 1, right_attach = 2) - for child in children: - if child != box: - child.props.xpad = extra_pad + if self.link_button.child is not None: + # Little hack to make the label inside the LinkButton align with all + # the others. The LinkButton has a margin around the label. A shadow + # (border) is drawn there on mouse over only, so it looks totally odd + # without this little adjustment. + button_req_width = self.link_button.size_request ()[0] + child_req_width = self.link_button.child.size_request ()[0] + extra_pad = (button_req_width - child_req_width) / 2 + children = [label] + children += iter_container (self.widgets.element_details_table, + left_attach = 1, right_attach = 2) + children += iter_container (self.widgets.plugin_details_table, + left_attach = 1, right_attach = 2) + for child in children: + if child != box: + child.props.xpad = extra_pad box.pack_start (self.link_button, False, False) |