Changeset 4571


Ignore:
Timestamp:
Jul 22, 2014 11:48:29 AM (10 years ago)
Author:
gah
Message:

fix placement of bugreport window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/gui/scripts/bugreport.tcl

    r4512 r4571  
    8787        set h [winfo reqheight .bugreport]
    8888
    89         set rootx [winfo rootx .main]
    90         set rooty [winfo rooty .main]
    91         set mw [winfo reqwidth .main]
    92         set mh [winfo reqheight .main]
    93        
    94         set x [expr { $rootx + (($mw-$w)/2) }]
    95         if {$x < 0} {set x 0}
    96         set y [expr { $rooty + (($mh-$h)/2) }]
    97         if {$y < 0} {set y 0}
    98        
     89        set x [winfo rootx .main]
     90        set y [winfo rooty .main]
     91
     92        set mw [winfo width .main]
     93        if { $mw == 1 } {
     94            set mw [winfo reqwidth .main]
     95        }           
     96        set mh [winfo height .main]
     97        if { $mh == 1 } {
     98            set mh [winfo reqwidth .main]
     99        }           
     100        if { $mw > $w } {
     101            set x [expr { $x + (($mw-$w)/2) }]
     102        }
     103        if { $mh > $h } {
     104            set y [expr { $y + (($mh-$h)/2) }]
     105        }
    99106        wm geometry .bugreport +$x+$y
    100107        raise .bugreport
     
    151158    set h [winfo reqheight .bugreport]
    152159
    153     set rootx [winfo rootx .main]
    154     set rooty [winfo rooty .main]
    155     set mw [winfo reqwidth .main]
    156     set mh [winfo reqheight .main]
    157 
    158     set x [expr { $rootx + (($mw-$w)/2) }]
    159     if {$x < 0} {set x 0}
    160     set y [expr { $rooty + (($mh-$h)/2) }]
    161     if {$y < 0} {set y 0}
     160    set x [winfo rootx .main]
     161    set y [winfo rooty .main]
     162
     163    set mw [winfo width .main]
     164    if { $mw == 1 } {
     165        set mw [winfo reqwidth .main]
     166    }           
     167    set mh [winfo height .main]
     168    if { $mh == 1 } {
     169        set mh [winfo reqwidth .main]
     170    }           
     171
     172    if { $mw > $w } {
     173        set x [expr { $x + (($mw-$w)/2) }]
     174    }
     175    if { $mh > $h } {
     176        set y [expr { $y + (($mh-$h)/2) }]
     177    }
    162178
    163179    wm geometry .bugreport +$x+$y
Note: See TracChangeset for help on using the changeset viewer.