diff options
author | Andrei Dinu <andrei.adrianx.dinu@intel.com> | 2013-05-15 09:59:26 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-22 12:38:12 +0100 |
commit | 8d1e77ec31972de5841eb7b0e8f5f7912774175f (patch) | |
tree | 8d0489651acbc8a4b7666e3ab5e79167a1f8e022 /bitbake | |
parent | b2ff1add530b1fec2fb7f385227a03db47015c37 (diff) | |
download | poky-8d1e77ec31972de5841eb7b0e8f5f7912774175f.tar.gz |
bitbake: propertydialog.py : Scrollable windows for long tooltips
In some cases, the length of the description and the brought
in by field was too big. That led to the size of the property
dialog exceeding Hob's size. For long tooltips we use
scrollable windows now.
[HOB #4321]
(Bitbake rev: 78ecabf19bf01e5a662b6e2b865cd93bf47d962b)
Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig/propertydialog.py | 63 |
1 files changed, 38 insertions, 25 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py b/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py index 5bd9f956b4..bc40741bf2 100644 --- a/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py +++ b/bitbake/lib/bb/ui/crumbs/hig/propertydialog.py | |||
@@ -275,24 +275,23 @@ class PropertyDialog(CrumbsDialog): | |||
275 | binb_items_count = len(binb.split(',')) | 275 | binb_items_count = len(binb.split(',')) |
276 | binb_items = binb.split(',') | 276 | binb_items = binb.split(',') |
277 | 277 | ||
278 | vbox = gtk.VBox(True,spacing = 0) | 278 | vbox = gtk.VBox(False,spacing = 0) |
279 | 279 | ||
280 | ######################################## SUMMARY LABEL ######################################### | 280 | ######################################## SUMMARY LABEL ######################################### |
281 | 281 | ||
282 | if summary != '': | 282 | if summary != '': |
283 | self.label_short = gtk.Label() | 283 | self.label_short = gtk.Label() |
284 | self.label_short.set_size_request(300,-1) | 284 | self.label_short.set_width_chars(37) |
285 | self.label_short.set_selectable(True) | 285 | self.label_short.set_selectable(True) |
286 | self.label_short.set_line_wrap(True) | 286 | self.label_short.set_line_wrap(True) |
287 | self.label_short.set_markup("<b>" + summary + "</b>") | 287 | self.label_short.set_markup("<b>" + summary + "</b>") |
288 | self.label_short.set_property("xalign", 0) | 288 | self.label_short.set_property("xalign", 0) |
289 | 289 | ||
290 | self.vbox.pack_start(self.label_short, expand=False, fill=False, padding=0) | 290 | self.vbox.add(self.label_short) |
291 | 291 | ||
292 | ########################################## NAME ROW + COL ####################################### | 292 | ########################################## NAME ROW + COL ####################################### |
293 | 293 | ||
294 | self.label_short = gtk.Label() | 294 | self.label_short = gtk.Label() |
295 | self.label_short.set_size_request(300,-1) | ||
296 | self.label_short.set_selectable(True) | 295 | self.label_short.set_selectable(True) |
297 | self.label_short.set_line_wrap(True) | 296 | self.label_short.set_line_wrap(True) |
298 | self.label_short.set_markup("<span weight=\"bold\">Name: </span>" + name) | 297 | self.label_short.set_markup("<span weight=\"bold\">Name: </span>" + name) |
@@ -303,7 +302,6 @@ class PropertyDialog(CrumbsDialog): | |||
303 | ####################################### VERSION ROW + COL #################################### | 302 | ####################################### VERSION ROW + COL #################################### |
304 | 303 | ||
305 | self.label_short = gtk.Label() | 304 | self.label_short = gtk.Label() |
306 | self.label_short.set_size_request(300,-1) | ||
307 | self.label_short.set_selectable(True) | 305 | self.label_short.set_selectable(True) |
308 | self.label_short.set_line_wrap(True) | 306 | self.label_short.set_line_wrap(True) |
309 | self.label_short.set_markup("<span weight=\"bold\">Version: </span>" + version) | 307 | self.label_short.set_markup("<span weight=\"bold\">Version: </span>" + version) |
@@ -314,7 +312,6 @@ class PropertyDialog(CrumbsDialog): | |||
314 | ##################################### REVISION ROW + COL ##################################### | 312 | ##################################### REVISION ROW + COL ##################################### |
315 | 313 | ||
316 | self.label_short = gtk.Label() | 314 | self.label_short = gtk.Label() |
317 | self.label_short.set_size_request(300,-1) | ||
318 | self.label_short.set_line_wrap(True) | 315 | self.label_short.set_line_wrap(True) |
319 | self.label_short.set_selectable(True) | 316 | self.label_short.set_selectable(True) |
320 | self.label_short.set_markup("<span weight=\"bold\">Revision: </span>" + revision) | 317 | self.label_short.set_markup("<span weight=\"bold\">Revision: </span>" + revision) |
@@ -325,7 +322,6 @@ class PropertyDialog(CrumbsDialog): | |||
325 | ################################## GROUP ROW + COL ############################################ | 322 | ################################## GROUP ROW + COL ############################################ |
326 | 323 | ||
327 | self.label_short = gtk.Label() | 324 | self.label_short = gtk.Label() |
328 | self.label_short.set_size_request(300,-1) | ||
329 | self.label_short.set_selectable(True) | 325 | self.label_short.set_selectable(True) |
330 | self.label_short.set_line_wrap(True) | 326 | self.label_short.set_line_wrap(True) |
331 | self.label_short.set_markup("<span weight=\"bold\">Group: </span>" + group) | 327 | self.label_short.set_markup("<span weight=\"bold\">Group: </span>" + group) |
@@ -347,7 +343,6 @@ class PropertyDialog(CrumbsDialog): | |||
347 | self.label_info.set_property("xalign", 0) | 343 | self.label_info.set_property("xalign", 0) |
348 | 344 | ||
349 | self.label_short = gtk.Label() | 345 | self.label_short = gtk.Label() |
350 | self.label_short.set_size_request(300,-1) | ||
351 | self.label_short.set_selectable(True) | 346 | self.label_short.set_selectable(True) |
352 | self.label_short.set_line_wrap(True) | 347 | self.label_short.set_line_wrap(True) |
353 | self.label_short.set_markup("<b>Homepage: </b>") | 348 | self.label_short.set_markup("<b>Homepage: </b>") |
@@ -369,7 +364,6 @@ class PropertyDialog(CrumbsDialog): | |||
369 | self.label_info.set_property("xalign", 0) | 364 | self.label_info.set_property("xalign", 0) |
370 | 365 | ||
371 | self.label_short = gtk.Label() | 366 | self.label_short = gtk.Label() |
372 | self.label_short.set_size_request(300,-1) | ||
373 | self.label_short.set_selectable(True) | 367 | self.label_short.set_selectable(True) |
374 | self.label_short.set_line_wrap(True) | 368 | self.label_short.set_line_wrap(True) |
375 | self.label_short.set_markup("<b>Bugtracker: </b>") | 369 | self.label_short.set_markup("<b>Bugtracker: </b>") |
@@ -381,7 +375,6 @@ class PropertyDialog(CrumbsDialog): | |||
381 | ################################# LICENSE ROW + COL ############################################ | 375 | ################################# LICENSE ROW + COL ############################################ |
382 | 376 | ||
383 | self.label_info = gtk.Label() | 377 | self.label_info = gtk.Label() |
384 | self.label_info.set_size_request(300,-1) | ||
385 | self.label_info.set_selectable(True) | 378 | self.label_info.set_selectable(True) |
386 | self.label_info.set_line_wrap(True) | 379 | self.label_info.set_line_wrap(True) |
387 | self.label_info.set_markup(license) | 380 | self.label_info.set_markup(license) |
@@ -404,16 +397,25 @@ class PropertyDialog(CrumbsDialog): | |||
404 | self.label_short.set_line_wrap(True) | 397 | self.label_short.set_line_wrap(True) |
405 | self.label_short.set_markup("<span weight=\"bold\">Brought in by: </span>") | 398 | self.label_short.set_markup("<span weight=\"bold\">Brought in by: </span>") |
406 | self.label_short.set_property("xalign", 0) | 399 | self.label_short.set_property("xalign", 0) |
407 | 400 | self.vbox.add(self.label_short) | |
408 | self.label_info = gtk.Label() | 401 | self.label_info = gtk.Label() |
409 | self.label_info.set_size_request(300,-1) | ||
410 | self.label_info.set_selectable(True) | 402 | self.label_info.set_selectable(True) |
411 | self.label_info.set_markup(binb) | 403 | self.label_info.set_width_chars(36) |
412 | self.label_info.set_property("xalign", 0) | 404 | if len(binb) > 200: |
413 | self.label_info.set_line_wrap(True) | 405 | scrolled_window = gtk.ScrolledWindow() |
414 | 406 | scrolled_window.set_policy(gtk.POLICY_NEVER,gtk.POLICY_ALWAYS) | |
415 | self.vbox.add(self.label_short) | 407 | scrolled_window.set_size_request(100,100) |
416 | self.vbox.add(self.label_info) | 408 | self.label_info.set_markup(binb) |
409 | self.label_info.set_padding(6,6) | ||
410 | self.label_info.set_alignment(0,0) | ||
411 | self.label_info.set_line_wrap(True) | ||
412 | scrolled_window.add_with_viewport(self.label_info) | ||
413 | self.vbox.add(scrolled_window) | ||
414 | else: | ||
415 | self.label_info.set_markup(binb) | ||
416 | self.label_info.set_property("xalign", 0) | ||
417 | self.label_info.set_line_wrap(True) | ||
418 | self.vbox.add(self.label_info) | ||
417 | 419 | ||
418 | ################################ DESCRIPTION TAG ROW ################################################# | 420 | ################################ DESCRIPTION TAG ROW ################################################# |
419 | 421 | ||
@@ -428,11 +430,22 @@ class PropertyDialog(CrumbsDialog): | |||
428 | hbox = gtk.HBox(True,spacing = 0) | 430 | hbox = gtk.HBox(True,spacing = 0) |
429 | 431 | ||
430 | self.label_short = gtk.Label() | 432 | self.label_short = gtk.Label() |
431 | self.label_short.set_size_request(300,-1) | 433 | self.label_short.set_selectable(True) |
432 | self.label_short.set_selectable(True) | 434 | self.label_short.set_width_chars(36) |
433 | self.label_short.set_text(description) | 435 | if len(description) > 200: |
434 | self.label_short.set_line_wrap(True) | 436 | scrolled_window = gtk.ScrolledWindow() |
435 | self.label_short.set_property("xalign", 0) | 437 | scrolled_window.set_policy(gtk.POLICY_NEVER,gtk.POLICY_ALWAYS) |
436 | self.vbox.add(self.label_short) | 438 | scrolled_window.set_size_request(100,100) |
439 | self.label_short.set_markup(description) | ||
440 | self.label_short.set_padding(6,6) | ||
441 | self.label_short.set_alignment(0,0) | ||
442 | self.label_short.set_line_wrap(True) | ||
443 | scrolled_window.add_with_viewport(self.label_short) | ||
444 | self.vbox.add(scrolled_window) | ||
445 | else: | ||
446 | self.label_short.set_markup(description) | ||
447 | self.label_short.set_property("xalign", 0) | ||
448 | self.label_short.set_line_wrap(True) | ||
449 | self.vbox.add(self.label_short) | ||
437 | 450 | ||
438 | self.vbox.show_all() | 451 | self.vbox.show_all() |