Changeset 166


Ignore:
Timestamp:
Jan 19, 2018, 10:32:39 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Main toolbar DPI scaling.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms

    • Property svn:ignore set to
      *.lrj
  • trunk/Forms/UFormMain.lfm

    r165 r166  
    6666  object PanelParam: TPanel
    6767    Left = 0
    68     Height = 38
    69     Top = 32
     68    Height = 32
     69    Top = 38
    7070    Width = 998
    7171    Align = alTop
    7272    BevelOuter = bvNone
    73     ClientHeight = 38
     73    ClientHeight = 32
    7474    ClientWidth = 998
    7575    TabOrder = 1
     
    101101  object CoolBar1: TCoolBar
    102102    Left = 0
    103     Height = 32
     103    Height = 38
    104104    Top = 0
    105105    Width = 998
     
    108108      item
    109109        Break = False
    110         Control = ToolBar1
     110        Control = ToolBarFile
    111111        FixedSize = True
    112112        MinWidth = 40
    113         Width = 136
     113        Width = 164
    114114      end   
    115115      item
    116116        Break = False
    117         Control = ToolBar2
     117        Control = ToolBarManage
    118118        FixedSize = True
    119119        MinWidth = 40
    120         Width = 126
     120        Width = 149
    121121      end   
    122122      item
    123123        Break = False
    124         Control = ToolBar3
     124        Control = ToolBarOther
    125125        FixedSize = True
    126126        MinWidth = 40
    127         Width = 80
     127        Width = 91
    128128      end   
    129129      item
    130130        Break = False
    131         Control = ToolBar4
     131        Control = ToolBarFilter
    132132        FixedSize = True
    133133        MinWidth = 40
    134         Width = 80
     134        Width = 120
    135135      end>
    136136    Images = Core.ImageList1
    137     object ToolBar1: TToolBar
     137    object ToolBarFile: TToolBar
    138138      AnchorSideLeft.Control = CoolBar1
    139139      AnchorSideTop.Control = CoolBar1
     
    141141      Height = 28
    142142      Top = 5
    143       Width = 132
     143      Width = 135
    144144      Align = alNone
    145145      AutoSize = True
     
    177177      end
    178178    end
    179     object ToolBar2: TToolBar
     179    object ToolBarManage: TToolBar
    180180      AnchorSideLeft.Control = CoolBar1
    181181      AnchorSideTop.Control = CoolBar1
    182       Left = 160
     182      Left = 188
    183183      Height = 28
    184184      Top = 5
    185       Width = 117
     185      Width = 120
    186186      Align = alNone
    187187      AutoSize = True
    188       BorderSpacing.Left = 158
     188      BorderSpacing.Left = 186
    189189      BorderSpacing.Top = 3
    190190      EdgeBorders = []
     
    217217      end
    218218    end
    219     object ToolBar3: TToolBar
     219    object ToolBarOther: TToolBar
    220220      AnchorSideLeft.Control = CoolBar1
    221221      AnchorSideTop.Control = CoolBar1
    222       Left = 286
     222      Left = 337
    223223      Height = 28
    224224      Top = 5
    225       Width = 59
     225      Width = 62
    226226      Align = alNone
    227227      AutoSize = True
    228       BorderSpacing.Left = 284
     228      BorderSpacing.Left = 335
    229229      BorderSpacing.Top = 3
    230230      EdgeBorders = []
     
    247247      end
    248248    end
    249     object ToolBar4: TToolBar
     249    object ToolBarFilter: TToolBar
    250250      AnchorSideLeft.Control = CoolBar1
    251251      AnchorSideTop.Control = CoolBar1
    252       Left = 366
     252      Left = 428
    253253      Height = 28
    254254      Top = 5
    255       Width = 88
     255      Width = 91
    256256      Align = alNone
    257257      AutoSize = True
    258       BorderSpacing.Left = 364
     258      BorderSpacing.Left = 426
    259259      BorderSpacing.Top = 3
    260260      EdgeBorders = []
  • trunk/Forms/UFormMain.pas

    r165 r166  
    8080    SaveDialog1: TSaveDialog;
    8181    StatusBar1: TStatusBar;
    82     ToolBar1: TToolBar;
    83     ToolBar2: TToolBar;
    84     ToolBar3: TToolBar;
    85     ToolBar4: TToolBar;
     82    ToolBarFile: TToolBar;
     83    ToolBarManage: TToolBar;
     84    ToolBarOther: TToolBar;
     85    ToolBarFilter: TToolBar;
    8686    ToolButton1: TToolButton;
    8787    ToolButton11: TToolButton;
     
    189189  I: Integer;
    190190begin
    191   for I := 0 to ToolBar1.ButtonCount - 1 do
    192     ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
    193   for I := 0 to ToolBar2.ButtonCount - 1 do
    194     ToolBar2.Buttons[I].Hint := ToolBar2.Buttons[I].Caption;
    195   for I := 0 to ToolBar3.ButtonCount - 1 do
    196     ToolBar3.Buttons[I].Hint := ToolBar3.Buttons[I].Caption;
    197   for I := 0 to ToolBar4.ButtonCount - 1 do
    198     ToolBar4.Buttons[I].Hint := ToolBar4.Buttons[I].Caption;
     191  for I := 0 to ToolBarFile.ButtonCount - 1 do
     192    ToolBarFile.Buttons[I].Hint := ToolBarFile.Buttons[I].Caption;
     193  for I := 0 to ToolBarManage.ButtonCount - 1 do
     194    ToolBarManage.Buttons[I].Hint := ToolBarManage.Buttons[I].Caption;
     195  for I := 0 to ToolBarOther.ButtonCount - 1 do
     196    ToolBarOther.Buttons[I].Hint := ToolBarOther.Buttons[I].Caption;
     197  for I := 0 to ToolBarFilter.ButtonCount - 1 do
     198    ToolBarFilter.Buttons[I].Hint := ToolBarFilter.Buttons[I].Caption;
    199199  PanelMain.ControlStyle := PanelMain.ControlStyle + [csOpaque];
    200200  PanelParam.ControlStyle := PanelParam.ControlStyle + [csOpaque];
  • trunk/Packages/Common/UScaleDPI.pas

    r139 r166  
    284284  WinControl: TWinControl;
    285285  ToolBarControl: TToolBar;
    286   OldAnchors: TAnchors;
    287   OldAutoSize: Boolean;
     286  //OldAnchors: TAnchors;
     287  //OldAutoSize: Boolean;
    288288begin
    289289  //if Control is TMemo then Exit;
     
    316316        MinWidth := ScaleX(MinWidth, FromDPI.X);
    317317        MinHeight := ScaleY(MinHeight, FromDPI.Y);
    318         Width := ScaleX(Width, FromDPI.X);
     318        // Workaround to bad band width auto sizing
     319        //Width := ScaleX(Width, FromDPI.X);
     320        Width := ScaleX(Control.Width + 28, FromDPI.X);
    319321        //Control.Invalidate;
    320322      end;
     323    // Workaround for bad autosizing of coolbar
     324    if AutoSize then begin
     325      AutoSize := False;
     326      Height := ScaleY(Height, FromDPI.Y);
     327    end;
    321328    EndUpdate;
    322329  end;
Note: See TracChangeset for help on using the changeset viewer.