2
0
Johann 6 жил өмнө
parent
commit
0cd7891ce7

+ 2 - 0
.gitignore

@@ -30,3 +30,5 @@ lazpaint/release/bin/lazpaint
 lazpaint/tools/backup/
 
 lazpaint/image/backup/
+
+lazpaint/dialog/backup/

+ 180 - 77
lazpaint/dialog/ubrowseimages.lfm

@@ -1,11 +1,12 @@
 object FBrowseImages: TFBrowseImages
   Left = 376
-  Height = 300
+  Height = 375
   Top = 101
-  Width = 684
+  Width = 855
   Caption = 'Browse images'
-  ClientHeight = 300
-  ClientWidth = 684
+  ClientHeight = 375
+  ClientWidth = 855
+  DesignTimePPI = 120
   KeyPreview = True
   OnCloseQuery = FormCloseQuery
   OnCreate = FormCreate
@@ -17,112 +18,120 @@ object FBrowseImages: TFBrowseImages
   OnUTF8KeyPress = FormUTF8KeyPress
   Position = poScreenCenter
   ShowInTaskBar = stAlways
-  LCLVersion = '2.0.0.4'
+  LCLVersion = '2.0.2.0'
   object Panel1: TPanel
-    Left = 464
-    Height = 300
+    Left = 580
+    Height = 375
     Top = 0
-    Width = 220
+    Width = 275
     Align = alClient
-    ClientHeight = 300
-    ClientWidth = 220
+    ClientHeight = 375
+    ClientWidth = 275
+    ParentFont = False
     TabOrder = 0
     object Label_Status: TLabel
-      Left = 3
-      Height = 17
-      Top = 5
-      Width = 3
+      Left = 4
+      Height = 22
+      Top = 6
+      Width = 4
       Caption = '.'
       ParentColor = False
+      ParentFont = False
     end
     object vsPreview: TBGRAVirtualScreen
-      Left = 3
-      Height = 270
-      Top = 26
-      Width = 214
+      Left = 4
+      Height = 338
+      Top = 32
+      Width = 267
       Alignment = taLeftJustify
       Anchors = [akTop, akLeft, akRight, akBottom]
       Color = clGray
       ParentColor = False
+      ParentFont = False
       TabOrder = 0
     end
     object ListBox_RecentDirs: TListBox
-      Left = 3
-      Height = 269
-      Top = 26
-      Width = 212
+      Left = 4
+      Height = 337
+      Top = 32
+      Width = 265
       Anchors = [akTop, akLeft, akRight, akBottom]
       ItemHeight = 0
       OnClick = ListBox_RecentDirsClick
-      ScrollWidth = 210
+      ParentFont = False
+      ScrollWidth = 263
       TabOrder = 1
       TopIndex = -1
     end
     object CheckBox_UseDirectoryOnStartup: TCheckBox
-      Left = 56
-      Height = 22
-      Top = 3
-      Width = 182
+      Left = 70
+      Height = 26
+      Top = 4
+      Width = 222
       Caption = 'Use this directory on startup'
       OnChange = CheckBox_UseDirectoryOnStartupChange
+      ParentFont = False
       TabOrder = 2
       Visible = False
     end
   end
   object Splitter1: TSplitter
-    Left = 458
-    Height = 300
+    Left = 572
+    Height = 375
     Top = 0
-    Width = 6
+    Width = 8
     MinSize = 64
   end
   object Panel2: TPanel
     Left = 0
-    Height = 300
+    Height = 375
     Top = 0
-    Width = 458
+    Width = 572
     Align = alLeft
-    ClientHeight = 300
-    ClientWidth = 458
+    ClientHeight = 375
+    ClientWidth = 572
+    ParentFont = False
     TabOrder = 2
     object Panel3: TPanel
       Left = 1
-      Height = 73
+      Height = 91
       Top = 1
-      Width = 456
+      Width = 570
       Align = alTop
-      ClientHeight = 73
-      ClientWidth = 456
+      ClientHeight = 91
+      ClientWidth = 570
+      ParentFont = False
       TabOrder = 0
       object ToolBar1: TToolBar
         Left = 1
-        Height = 33
+        Height = 41
         Top = 2
-        Width = 225
+        Width = 281
         Align = alNone
-        ButtonHeight = 32
-        ButtonWidth = 32
+        ButtonHeight = 40
+        ButtonWidth = 40
         EdgeBorders = []
         Images = ImageListToolbar
+        ParentFont = False
         ParentShowHint = False
         ShowHint = True
         TabOrder = 0
         object ToolButton_GoUp: TToolButton
-          Left = 145
+          Left = 161
           Hint = 'Go one directory up'
           Top = 0
           ImageIndex = 0
           OnClick = ToolButton_GoUpClick
         end
         object ToolButton_ViewBigIcon: TToolButton
-          Left = 73
+          Left = 81
           Hint = 'Show big icons'
           Top = 0
           ImageIndex = 2
           OnClick = ToolButton_ViewBigIconClick
         end
         object ToolButton_ViewDetails: TToolButton
-          Left = 37
+          Left = 41
           Hint = 'Show details and preview'
           Top = 0
           ImageIndex = 3
@@ -137,7 +146,7 @@ object FBrowseImages: TFBrowseImages
           OnClick = ToolButton_OpenSelectedFilesClick
         end
         object Tool_SelectDrive: TToolButton
-          Left = 109
+          Left = 121
           Hint = 'Select drive'
           Top = 0
           ImageIndex = 6
@@ -145,52 +154,146 @@ object FBrowseImages: TFBrowseImages
           Visible = False
         end
         object ToolButton_CreateFolderOrContainer: TToolButton
-          Left = 181
+          Left = 201
           Hint = 'Create folder or container'
           Top = 0
           ImageIndex = 8
           OnClick = ToolButton_CreateFolderOrContainerClick
         end
       end
-      object ComboBox_FileExtension: TComboBox
-        Left = 5
-        Height = 31
-        Top = 40
-        Width = 211
-        ItemHeight = 0
-        OnChange = ComboBox_FileExtensionChange
-        Style = csDropDownList
-        TabOrder = 1
-        TabStop = False
-      end
       object Edit_Filename: TEdit
-        Left = 224
-        Height = 27
-        Top = 40
-        Width = 224
+        Left = 280
+        Height = 34
+        Top = 50
+        Width = 280
         Anchors = [akTop, akLeft, akRight]
         OnChange = Edit_FilenameChange
-        TabOrder = 2
+        ParentFont = False
+        TabOrder = 1
       end
       object DirectoryEdit1: TEdit
-        Left = 224
-        Height = 27
-        Top = 5
-        Width = 224
+        Left = 280
+        Height = 34
+        Top = 6
+        Width = 280
         Anchors = [akTop, akLeft, akRight]
         OnChange = DirectoryEdit1Change
-        TabOrder = 3
+        ParentFont = False
+        TabOrder = 2
+      end
+      object ComboBox_FileExtension: TBCComboBox
+        Left = 8
+        Height = 34
+        Top = 50
+        Width = 262
+        ItemIndex = -1
+        ArrowSize = 8
+        ArrowWidth = 16
+        GlobalOpacity = 255
+        MemoryUsage = bmuHigh
+        Rounding.RoundX = 3
+        Rounding.RoundY = 3
+        StateClicked.Background.Gradient1.StartColor = clBtnShadow
+        StateClicked.Background.Gradient1.EndColor = clBtnFace
+        StateClicked.Background.Gradient1.GradientType = gtLinear
+        StateClicked.Background.Gradient1.Point1XPercent = 0
+        StateClicked.Background.Gradient1.Point1YPercent = 0
+        StateClicked.Background.Gradient1.Point2XPercent = 0
+        StateClicked.Background.Gradient1.Point2YPercent = 250
+        StateClicked.Background.Gradient2.StartColor = clBtnShadow
+        StateClicked.Background.Gradient2.EndColor = clBtnText
+        StateClicked.Background.Gradient2.GradientType = gtLinear
+        StateClicked.Background.Gradient2.Point1XPercent = 0
+        StateClicked.Background.Gradient2.Point1YPercent = 0
+        StateClicked.Background.Gradient2.Point2XPercent = 0
+        StateClicked.Background.Gradient2.Point2YPercent = 100
+        StateClicked.Background.Gradient1EndPercent = 70
+        StateClicked.Background.Style = bbsGradient
+        StateClicked.Border.Color = clBtnShadow
+        StateClicked.Border.LightOpacity = 100
+        StateClicked.Border.LightWidth = 1
+        StateClicked.Border.Style = bboSolid
+        StateClicked.FontEx.Color = clBtnText
+        StateClicked.FontEx.FontQuality = fqFineAntialiasing
+        StateClicked.FontEx.Shadow = False
+        StateClicked.FontEx.ShadowRadius = 5
+        StateClicked.FontEx.ShadowOffsetX = 5
+        StateClicked.FontEx.ShadowOffsetY = 5
+        StateClicked.FontEx.Style = []
+        StateClicked.FontEx.TextAlignment = bcaLeftCenter
+        StateClicked.FontEx.PaddingLeft = 3
+        StateHover.Background.Gradient1.StartColor = clBtnFace
+        StateHover.Background.Gradient1.EndColor = clBtnHighlight
+        StateHover.Background.Gradient1.GradientType = gtLinear
+        StateHover.Background.Gradient1.Point1XPercent = 0
+        StateHover.Background.Gradient1.Point1YPercent = 0
+        StateHover.Background.Gradient1.Point2XPercent = 0
+        StateHover.Background.Gradient1.Point2YPercent = 150
+        StateHover.Background.Gradient2.StartColor = clBtnFace
+        StateHover.Background.Gradient2.EndColor = clBtnShadow
+        StateHover.Background.Gradient2.GradientType = gtLinear
+        StateHover.Background.Gradient2.Point1XPercent = 0
+        StateHover.Background.Gradient2.Point1YPercent = 0
+        StateHover.Background.Gradient2.Point2XPercent = 0
+        StateHover.Background.Gradient2.Point2YPercent = 100
+        StateHover.Background.Gradient1EndPercent = 85
+        StateHover.Background.Style = bbsGradient
+        StateHover.Border.Color = clBtnShadow
+        StateHover.Border.LightOpacity = 200
+        StateHover.Border.LightWidth = 1
+        StateHover.Border.Style = bboSolid
+        StateHover.FontEx.Color = clBtnText
+        StateHover.FontEx.FontQuality = fqFineAntialiasing
+        StateHover.FontEx.Shadow = False
+        StateHover.FontEx.ShadowRadius = 5
+        StateHover.FontEx.ShadowOffsetX = 5
+        StateHover.FontEx.ShadowOffsetY = 5
+        StateHover.FontEx.Style = []
+        StateHover.FontEx.TextAlignment = bcaLeftCenter
+        StateHover.FontEx.PaddingLeft = 3
+        StateNormal.Background.Gradient1.StartColor = clBtnFace
+        StateNormal.Background.Gradient1.EndColor = clBtnHighlight
+        StateNormal.Background.Gradient1.GradientType = gtLinear
+        StateNormal.Background.Gradient1.Point1XPercent = 0
+        StateNormal.Background.Gradient1.Point1YPercent = 0
+        StateNormal.Background.Gradient1.Point2XPercent = 0
+        StateNormal.Background.Gradient1.Point2YPercent = 150
+        StateNormal.Background.Gradient2.StartColor = clBtnFace
+        StateNormal.Background.Gradient2.EndColor = clBtnShadow
+        StateNormal.Background.Gradient2.GradientType = gtLinear
+        StateNormal.Background.Gradient2.Point1XPercent = 0
+        StateNormal.Background.Gradient2.Point1YPercent = 0
+        StateNormal.Background.Gradient2.Point2XPercent = 0
+        StateNormal.Background.Gradient2.Point2YPercent = 100
+        StateNormal.Background.Gradient1EndPercent = 70
+        StateNormal.Background.Style = bbsGradient
+        StateNormal.Border.Color = clBtnShadow
+        StateNormal.Border.LightOpacity = 200
+        StateNormal.Border.LightWidth = 1
+        StateNormal.Border.Style = bboSolid
+        StateNormal.FontEx.Color = clBtnText
+        StateNormal.FontEx.FontQuality = fqFineAntialiasing
+        StateNormal.FontEx.Shadow = False
+        StateNormal.FontEx.ShadowRadius = 5
+        StateNormal.FontEx.ShadowOffsetX = 5
+        StateNormal.FontEx.ShadowOffsetY = 5
+        StateNormal.FontEx.Style = []
+        StateNormal.FontEx.TextAlignment = bcaLeftCenter
+        StateNormal.FontEx.PaddingLeft = 3
+        StaticButton = False
+        OnChange = ComboBox_FileExtensionChange
       end
     end
     object vsList: TBGRAVirtualScreen
       Left = 1
-      Height = 225
-      Top = 74
-      Width = 456
+      Height = 282
+      Top = 92
+      Width = 570
       Align = alClient
       Alignment = taLeftJustify
       Color = clWindow
       ParentColor = False
+      ParentFont = False
       TabOrder = 1
       TabStop = True
     end
@@ -198,8 +301,8 @@ object FBrowseImages: TFBrowseImages
   object ImageList128: TImageList
     Height = 128
     Width = 128
-    left = 40
-    top = 176
+    left = 50
+    top = 220
     Bitmap = {
       4C69080000008000000080000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
       FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
@@ -16592,14 +16695,14 @@ object FBrowseImages: TFBrowseImages
     Enabled = False
     Interval = 30
     OnTimer = Timer1Timer
-    left = 256
-    top = 176
+    left = 320
+    top = 220
   end
   object ImageListToolbar: TImageList
     Height = 32
     Width = 32
-    left = 187
-    top = 177
+    left = 234
+    top = 221
     Bitmap = {
       4C69090000002000000020000000000000000000000000000000000000000000
       0000000000000000000000000000000000000000000000000000000000000000

+ 6 - 5
lazpaint/dialog/ubrowseimages.pas

@@ -5,10 +5,10 @@ unit ubrowseimages;
 interface
 
 uses
-  Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
-  ComCtrls, ExtCtrls, Buttons, StdCtrls, BGRAVirtualScreen, BGRABitmap,
-  BGRABitmapTypes, BGRAAnimatedGif, UMySLV, LazPaintType, Masks, LCLType,
-  UFileSystem, UImagePreview;
+  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls,
+  Buttons, StdCtrls, BGRAVirtualScreen, BCComboBox, BGRABitmap, BGRABitmapTypes,
+  BGRAAnimatedGif, UMySLV, LazPaintType, Masks, LCLType, UFileSystem,
+  UImagePreview;
 
 const
   MaxIconCacheCount = 512;
@@ -18,6 +18,7 @@ type
   { TFBrowseImages }
 
   TFBrowseImages = class(TForm)
+    ComboBox_FileExtension: TBCComboBox;
     CheckBox_UseDirectoryOnStartup: TCheckBox;
     DirectoryEdit1: TEdit;
     ToolButton_CreateFolderOrContainer: TToolButton;
@@ -25,7 +26,6 @@ type
     ToolButtonSeparator: TToolButton;
     ToolButton_OpenSelectedFiles: TToolButton;
     vsList: TBGRAVirtualScreen;
-    ComboBox_FileExtension: TComboBox;
     Edit_Filename: TEdit;
     ListBox_RecentDirs: TListBox;
     Panel3: TPanel;
@@ -262,6 +262,7 @@ begin
   FPreview.OnValidate:= @PreviewValidate;
   FChosenImage := TImageEntry.Empty;
 
+  BCAssignSystemStyle(ComboBox_FileExtension, False);
   InitComboExt;
 
   bmp := TBitmap.Create;

+ 50 - 5
lazpaint/ugraph.pas

@@ -56,7 +56,8 @@ function WaveDisplacementFilter(source: TBGRACustomBitmap;
 function DoResample(source :TBGRABitmap; newWidth, newHeight: integer; StretchMode: TResampleMode): TBGRABitmap;
 procedure DrawArrow(AComboBox: TBCComboBox; ARect: TRect; AStart: boolean; AKindStr: string; ALineCap: TPenEndCap; State: TOwnerDrawState); overload;
 procedure DrawArrow(ABitmap: TBGRABitmap; ARect: TRect; AStart: boolean; AKindStr: string; ALineCap: TPenEndCap; AColor: TBGRAPixel); overload;
-procedure BCAssignSystemStyle(AButton: TBCButton; ADarkTheme: boolean);
+procedure BCAssignSystemStyle(AButton: TBCButton; ADarkTheme: boolean; AFontHeightRatio: single = 0.45);
+procedure BCAssignSystemStyle(ACombo: TBCComboBox; ADarkTheme: boolean; AFontHeightRatio: single = 0.45);
 
 implementation
 
@@ -106,7 +107,7 @@ begin
   end;
 end;
 
-procedure BCAssignSystemStyle(AButton: TBCButton; ADarkTheme: boolean);
+procedure BCAssignSystemStyle(AButton: TBCButton; ADarkTheme: boolean; AFontHeightRatio: single);
 
   function MergeColor(AColor1,AColor2:TColor):TColor;
   begin
@@ -131,7 +132,7 @@ begin
     highlight := $a0a0a0;
     btnFace := clDarkEditableFace;
     btnText := clLightText;
-    btnShadow:= clBlack;
+    btnShadow:= clDarkPanelShadow;
   end else
   begin
     {$IFDEF DARWIN}
@@ -145,14 +146,58 @@ begin
   end;
   with AButton do
   begin
-    Rounding.RoundX := 6;
-    Rounding.RoundY := 6;
+    Rounding.RoundX := DoScaleX(3, OriginalDPI);
+    Rounding.RoundY := DoScaleX(3, OriginalDPI);
     BCAssignSystemState(StateNormal, btnText, btnFace, highlight, btnFace, btnShadow, btnShadow);
     BCAssignSystemState(StateHover, HoverColor(btnText), HoverColor(btnFace), HoverColor(highlight), HoverColor(btnFace), HoverColor(btnShadow), HoverColor(btnShadow));
     BCAssignSystemState(StateClicked, HoverColor(btnText), HoverColor(MergeColor(btnFace,btnShadow)), HoverColor(btnFace), HoverColor(MergeColor(btnFace,btnShadow)), HoverColor(btnShadow), HoverColor(btnShadow));
+    StateNormal.Border.LightWidth := 0;
+    StateNormal.FontEx.Height := round(AButton.Height*AFontHeightRatio);
+    StateNormal.FontEx.ShadowColorOpacity:= 70;
+    StateNormal.FontEx.TextAlignment:= bcaLeftCenter;
+    StateNormal.FontEx.PaddingLeft:= DoScaleX(3, OriginalDPI);
+    StateHover.Border.LightWidth := 0;
+    StateHover.FontEx.Height := round(AButton.Height*AFontHeightRatio);
+    StateHover.FontEx.ShadowColorOpacity:= 70;
+    StateHover.FontEx.TextAlignment:= bcaLeftCenter;
+    StateHover.FontEx.PaddingLeft:= DoScaleX(3, OriginalDPI);
+    StateClicked.Border.LightWidth := 0;
+    StateClicked.FontEx.Height := round(AButton.Height*AFontHeightRatio);
+    StateClicked.FontEx.ShadowColorOpacity:= 70;
+    StateClicked.FontEx.TextAlignment:= bcaLeftCenter;
+    StateClicked.FontEx.PaddingLeft:= DoScaleX(3, OriginalDPI);
   end;
 end;
 
+procedure BCAssignSystemStyle(ACombo: TBCComboBox; ADarkTheme: boolean;
+  AFontHeightRatio: single);
+begin
+  BCAssignSystemStyle(ACombo.Button, ADarkTheme, AFontHeightRatio);
+  with ACombo do
+  begin
+    Button.StateNormal.FontEx.Height := round(AFontHeightRatio*Height);
+    Button.StateNormal.FontEx.ShadowColorOpacity:= 96;
+    Button.StateClicked.FontEx.Height := round(AFontHeightRatio*Height);
+    Button.StateClicked.FontEx.ShadowColorOpacity:= 96;
+    Button.StateHover.FontEx.Height := round(AFontHeightRatio*Height);
+    Button.StateHover.FontEx.ShadowColorOpacity:= 96;
+    if ADarkTheme then
+    begin
+      DropDownBorderColor:= clBlack;
+      DropDownFontColor:= clLightText;
+      DropDownColor:= clDarkBtnFace;
+    end else
+    begin
+      DropDownBorderColor := MergeBGRA(ColorToBGRA(clWindowText),ColorToBGRA(clWindow));
+      DropDownFontColor:= clWindowText;
+      DropDownColor:= clWindow;
+    end;
+    DropDownFontHighlight:= clHighlightText;
+    DropDownHighlight:= clHighlight;
+  end;
+
+end;
+
 function ComputeRatio(ARatio: string): single;
 var
   idxCol,errPos: Integer;

+ 145 - 73
lazpaint/ulayerstack.lfm

@@ -1,15 +1,16 @@
 object FLayerStack: TFLayerStack
   Left = 554
-  Height = 108
-  Top = 245
-  Width = 245
+  Height = 216
+  Top = 164
+  Width = 306
   BorderIcons = [biSystemMenu]
   BorderStyle = bsSizeToolWin
   Caption = 'Layers'
-  ClientHeight = 108
-  ClientWidth = 245
-  Constraints.MinHeight = 108
-  Constraints.MinWidth = 245
+  ClientHeight = 216
+  ClientWidth = 306
+  Constraints.MinHeight = 135
+  Constraints.MinWidth = 306
+  DesignTimePPI = 120
   FormStyle = fsStayOnTop
   OnActivate = FormActivate
   OnCreate = FormCreate
@@ -21,14 +22,15 @@ object FLayerStack: TFLayerStack
   LCLVersion = '2.0.2.0'
   object BGRALayerStack: TBGRAVirtualScreen
     Left = 0
-    Height = 37
-    Top = 21
-    Width = 245
+    Height = 128
+    Top = 26
+    Width = 306
     OnRedraw = BGRALayerStackRedraw
     Align = alClient
     Alignment = taLeftJustify
     Color = clWindow
     ParentColor = False
+    ParentFont = False
     TabOrder = 0
     OnMouseDown = BGRALayerStackMouseDown
     OnMouseMove = BGRALayerStackMouseMove
@@ -38,31 +40,33 @@ object FLayerStack: TFLayerStack
   end
   object Panel1: TPanel
     Left = 0
-    Height = 50
-    Top = 58
-    Width = 245
+    Height = 62
+    Top = 154
+    Width = 306
     Align = alBottom
-    ClientHeight = 50
-    ClientWidth = 245
+    ClientHeight = 62
+    ClientWidth = 306
+    ParentFont = False
     TabOrder = 1
     object ToolBar1: TToolBar
-      Left = 170
-      Height = 24
+      Left = 212
+      Height = 30
       Top = 2
-      Width = 71
+      Width = 89
       Align = alNone
       Anchors = [akTop, akRight]
-      ButtonHeight = 20
-      ButtonWidth = 20
+      ButtonHeight = 25
+      ButtonWidth = 25
       EdgeBorders = []
       EdgeInner = esNone
       EdgeOuter = esNone
       Images = FMain.ImageList16
+      ParentFont = False
       ParentShowHint = False
       ShowHint = True
       TabOrder = 0
       object ToolZoomLayerStackIn: TToolButton
-        Left = 21
+        Left = 26
         Hint = 'Zoom layer stack in'
         Top = 0
         ImageIndex = 6
@@ -76,56 +80,45 @@ object FLayerStack: TFLayerStack
         OnClick = ToolZoomLayerStackOutClick
       end
       object ToolButton1: TToolButton
-        Left = 41
+        Left = 51
         Top = 0
         Action = FMain.LayerRemoveCurrent
       end
     end
-    object ComboBox_BlendOp: TComboBox
-      Left = 26
-      Height = 28
-      Top = 2
-      Width = 144
-      Anchors = [akTop, akLeft, akRight]
-      Font.Height = -10
-      ItemHeight = 0
-      OnChange = ComboBox_BlendOpChange
-      ParentFont = False
-      Style = csDropDownList
-      TabOrder = 1
-    end
     object ToolBar2: TToolBar
       Left = 1
-      Height = 24
-      Top = 25
-      Width = 243
+      Height = 30
+      Top = 31
+      Width = 304
       Align = alNone
       Anchors = [akTop, akLeft, akRight]
-      ButtonHeight = 20
-      ButtonWidth = 20
+      ButtonHeight = 25
+      ButtonWidth = 25
       EdgeBorders = []
       EdgeInner = esNone
       EdgeOuter = esNone
       Images = FMain.ImageList16
+      ParentFont = False
       ParentShowHint = False
       ShowHint = True
-      TabOrder = 2
+      TabOrder = 1
     end
     object ToolBar3: TToolBar
       Left = 1
-      Height = 24
+      Height = 30
       Top = 2
-      Width = 24
+      Width = 30
       Align = alNone
-      ButtonHeight = 20
-      ButtonWidth = 20
+      ButtonHeight = 25
+      ButtonWidth = 25
       EdgeBorders = []
       EdgeInner = esNone
       EdgeOuter = esNone
       Images = FMain.ImageList16
+      ParentFont = False
       ParentShowHint = False
       ShowHint = True
-      TabOrder = 3
+      TabOrder = 2
       object ToolBlendOp: TToolButton
         Left = 1
         Hint = 'Select blend operation'
@@ -134,69 +127,148 @@ object FLayerStack: TFLayerStack
         OnClick = ToolBlendOpClick
       end
     end
+    object ComboBox_BlendOp: TBCComboBox
+      Left = 32
+      Height = 26
+      Top = 4
+      Width = 178
+      ItemIndex = -1
+      ArrowSize = 8
+      ArrowWidth = 16
+      GlobalOpacity = 255
+      MemoryUsage = bmuHigh
+      Rounding.RoundX = 3
+      Rounding.RoundY = 3
+      StateClicked.Background.Gradient1.StartColor = clBtnShadow
+      StateClicked.Background.Gradient1.EndColor = clBtnFace
+      StateClicked.Background.Gradient1.GradientType = gtLinear
+      StateClicked.Background.Gradient1.Point1XPercent = 0
+      StateClicked.Background.Gradient1.Point1YPercent = 0
+      StateClicked.Background.Gradient1.Point2XPercent = 0
+      StateClicked.Background.Gradient1.Point2YPercent = 250
+      StateClicked.Background.Gradient2.StartColor = clBtnShadow
+      StateClicked.Background.Gradient2.EndColor = clBtnText
+      StateClicked.Background.Gradient2.GradientType = gtLinear
+      StateClicked.Background.Gradient2.Point1XPercent = 0
+      StateClicked.Background.Gradient2.Point1YPercent = 0
+      StateClicked.Background.Gradient2.Point2XPercent = 0
+      StateClicked.Background.Gradient2.Point2YPercent = 100
+      StateClicked.Background.Gradient1EndPercent = 70
+      StateClicked.Background.Style = bbsGradient
+      StateClicked.Border.Color = clBtnShadow
+      StateClicked.Border.LightOpacity = 100
+      StateClicked.Border.LightWidth = 1
+      StateClicked.Border.Style = bboSolid
+      StateClicked.FontEx.Color = clBtnText
+      StateClicked.FontEx.FontQuality = fqFineAntialiasing
+      StateClicked.FontEx.Shadow = False
+      StateClicked.FontEx.ShadowRadius = 5
+      StateClicked.FontEx.ShadowOffsetX = 5
+      StateClicked.FontEx.ShadowOffsetY = 5
+      StateClicked.FontEx.Style = []
+      StateClicked.FontEx.TextAlignment = bcaLeftCenter
+      StateClicked.FontEx.PaddingLeft = 3
+      StateHover.Background.Gradient1.StartColor = clBtnFace
+      StateHover.Background.Gradient1.EndColor = clBtnHighlight
+      StateHover.Background.Gradient1.GradientType = gtLinear
+      StateHover.Background.Gradient1.Point1XPercent = 0
+      StateHover.Background.Gradient1.Point1YPercent = 0
+      StateHover.Background.Gradient1.Point2XPercent = 0
+      StateHover.Background.Gradient1.Point2YPercent = 150
+      StateHover.Background.Gradient2.StartColor = clBtnFace
+      StateHover.Background.Gradient2.EndColor = clBtnShadow
+      StateHover.Background.Gradient2.GradientType = gtLinear
+      StateHover.Background.Gradient2.Point1XPercent = 0
+      StateHover.Background.Gradient2.Point1YPercent = 0
+      StateHover.Background.Gradient2.Point2XPercent = 0
+      StateHover.Background.Gradient2.Point2YPercent = 100
+      StateHover.Background.Gradient1EndPercent = 85
+      StateHover.Background.Style = bbsGradient
+      StateHover.Border.Color = clBtnShadow
+      StateHover.Border.LightOpacity = 200
+      StateHover.Border.LightWidth = 1
+      StateHover.Border.Style = bboSolid
+      StateHover.FontEx.Color = clBtnText
+      StateHover.FontEx.FontQuality = fqFineAntialiasing
+      StateHover.FontEx.Shadow = False
+      StateHover.FontEx.ShadowRadius = 5
+      StateHover.FontEx.ShadowOffsetX = 5
+      StateHover.FontEx.ShadowOffsetY = 5
+      StateHover.FontEx.Style = []
+      StateHover.FontEx.TextAlignment = bcaLeftCenter
+      StateHover.FontEx.PaddingLeft = 3
+      StateNormal.Background.Gradient1.StartColor = clBtnFace
+      StateNormal.Background.Gradient1.EndColor = clBtnHighlight
+      StateNormal.Background.Gradient1.GradientType = gtLinear
+      StateNormal.Background.Gradient1.Point1XPercent = 0
+      StateNormal.Background.Gradient1.Point1YPercent = 0
+      StateNormal.Background.Gradient1.Point2XPercent = 0
+      StateNormal.Background.Gradient1.Point2YPercent = 150
+      StateNormal.Background.Gradient2.StartColor = clBtnFace
+      StateNormal.Background.Gradient2.EndColor = clBtnShadow
+      StateNormal.Background.Gradient2.GradientType = gtLinear
+      StateNormal.Background.Gradient2.Point1XPercent = 0
+      StateNormal.Background.Gradient2.Point1YPercent = 0
+      StateNormal.Background.Gradient2.Point2XPercent = 0
+      StateNormal.Background.Gradient2.Point2YPercent = 100
+      StateNormal.Background.Gradient1EndPercent = 70
+      StateNormal.Background.Style = bbsGradient
+      StateNormal.Border.Color = clBtnShadow
+      StateNormal.Border.LightOpacity = 200
+      StateNormal.Border.LightWidth = 1
+      StateNormal.Border.Style = bboSolid
+      StateNormal.FontEx.Color = clBtnText
+      StateNormal.FontEx.FontQuality = fqFineAntialiasing
+      StateNormal.FontEx.Shadow = False
+      StateNormal.FontEx.ShadowRadius = 5
+      StateNormal.FontEx.ShadowOffsetX = 5
+      StateNormal.FontEx.ShadowOffsetY = 5
+      StateNormal.FontEx.Style = []
+      StateNormal.FontEx.TextAlignment = bcaLeftCenter
+      StateNormal.FontEx.PaddingLeft = 3
+      StaticButton = False
+      OnChange = ComboBox_BlendOpChange
+    end
   end
   object Panel_WindowTitle: TBCPanel
     Left = 0
-    Height = 21
+    Height = 26
     Top = 0
-    Width = 245
+    Width = 306
     Align = alTop
     Background.Color = clInactiveCaption
-    Background.ColorOpacity = 255
     Background.Gradient1.StartColor = clWhite
-    Background.Gradient1.StartColorOpacity = 255
-    Background.Gradient1.DrawMode = dmSet
     Background.Gradient1.EndColor = clBlack
-    Background.Gradient1.EndColorOpacity = 255
-    Background.Gradient1.ColorCorrection = True
     Background.Gradient1.GradientType = gtLinear
     Background.Gradient1.Point1XPercent = 0
     Background.Gradient1.Point1YPercent = 0
     Background.Gradient1.Point2XPercent = 0
     Background.Gradient1.Point2YPercent = 100
-    Background.Gradient1.Sinus = False
     Background.Gradient2.StartColor = clWhite
-    Background.Gradient2.StartColorOpacity = 255
-    Background.Gradient2.DrawMode = dmSet
     Background.Gradient2.EndColor = clBlack
-    Background.Gradient2.EndColorOpacity = 255
-    Background.Gradient2.ColorCorrection = True
     Background.Gradient2.GradientType = gtLinear
     Background.Gradient2.Point1XPercent = 0
     Background.Gradient2.Point1YPercent = 0
     Background.Gradient2.Point2XPercent = 0
     Background.Gradient2.Point2YPercent = 100
-    Background.Gradient2.Sinus = False
     Background.Gradient1EndPercent = 35
     Background.Style = bbsColor
     BevelInner = bvNone
     BevelOuter = bvNone
     BevelWidth = 1
-    Border.Color = clBlack
-    Border.ColorOpacity = 255
-    Border.LightColor = clWhite
-    Border.LightOpacity = 255
-    Border.LightWidth = 0
     Border.Style = bboSolid
-    Border.Width = 1
     BorderBCStyle = bpsBorder
     FontEx.Color = clInactiveCaptionText
-    FontEx.EndEllipsis = False
     FontEx.FontQuality = fqSystemClearType
     FontEx.Height = -15
-    FontEx.SingleLine = True
     FontEx.Shadow = False
-    FontEx.ShadowColor = clBlack
-    FontEx.ShadowColorOpacity = 255
     FontEx.ShadowRadius = 5
     FontEx.ShadowOffsetX = 5
     FontEx.ShadowOffsetY = 5
     FontEx.Style = []
     FontEx.TextAlignment = bcaLeftCenter
-    FontEx.WordBreak = False
     Rounding.RoundX = 1
     Rounding.RoundY = 1
-    Rounding.RoundOptions = []
     TabOrder = 2
     Visible = False
   end
@@ -204,7 +276,7 @@ object FLayerStack: TFLayerStack
     Enabled = False
     Interval = 30
     OnTimer = TimerScrollTimer
-    left = 134
-    top = 49
+    left = 168
+    top = 61
   end
 end

+ 8 - 7
lazpaint/ulayerstack.pas

@@ -6,8 +6,9 @@ interface
 
 uses
   Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
-  ComCtrls, ExtCtrls, StdCtrls, BGRAVirtualScreen, BCPanel, LazPaintType,
-  BGRABitmap, UVolatileScrollBar, Types, BGRABitmapTypes, UImageObservation;
+  ComCtrls, ExtCtrls, StdCtrls, BGRAVirtualScreen, BCPanel, BCComboBox,
+  LazPaintType, BGRABitmap, UVolatileScrollBar, Types, BGRABitmapTypes,
+  UImageObservation;
 
 type
   TDrawLayerItemResult = record
@@ -24,9 +25,9 @@ type
   { TFLayerStack }
 
   TFLayerStack = class(TForm)
+    ComboBox_BlendOp: TBCComboBox;
     Panel_WindowTitle: TBCPanel;
     BGRALayerStack: TBGRAVirtualScreen;
-    ComboBox_BlendOp: TComboBox;
     Panel1: TPanel;
     TimerScroll: TTimer;
     ToolBar1: TToolBar;
@@ -114,7 +115,7 @@ var TFLayerStack_CustomDPI: integer = 96;
 implementation
 
 uses BGRAFillInfo,LCScaleDPI,uresourcestrings,ublendop, uimage, utool, BGRAText, BGRAThumbnail,
-   BGRALayerOriginal, math, BGRATransform, BGRASVGOriginal, udarktheme;
+   BGRALayerOriginal, math, BGRATransform, BGRASVGOriginal, udarktheme, ugraph;
 
 function TFLayerStack.DrawLayerItem(ABitmap: TBGRABitmap; layerPos: TPoint; layerIndex: integer; ASelected: boolean): TDrawLayerItemResult;
 var
@@ -278,10 +279,9 @@ begin
   Toolbar2.Top := Toolbar1.Top + Toolbar1.Height;
   Panel1.Height := Toolbar2.Top+Toolbar2.Height+2;
 
-  ComboBox_BlendOp.Font.Height := -FontEmHeightSign * ((images.Height-2) * 6 div 10 + 2);
+  ComboBox_BlendOp.Top := ToolBar1.Top;
+  ComboBox_BlendOp.Height := ToolBar1.ButtonHeight+1;
 
-  if Toolbar2.Top < ComboBox_BlendOp.Top + ComboBox_BlendOp.Height then
-    Toolbar2.Top := ComboBox_BlendOp.Top + ComboBox_BlendOp.Height;
   if Toolbar2.Top+Toolbar2.Height+2 > Panel1.Height then
     Panel1.Height := Toolbar2.Top+Toolbar2.Height+2;
 
@@ -844,6 +844,7 @@ begin
   DarkThemeInstance.Apply(ToolBar2, DarkTheme);
   DarkThemeInstance.Apply(ToolBar3, DarkTheme);
   BGRALayerStack.Color:= GetBackColor(False);
+  BCAssignSystemStyle(ComboBox_BlendOp, DarkTheme, 0.5);
 end;
 
 function TFLayerStack.GetTextColor(ASelected: boolean): TColor;

+ 2 - 25
lazpaint/umenu.pas

@@ -209,7 +209,7 @@ end;
 
 procedure TMainFormMenu.ApplyTheme;
 var
-  i, j, h: Integer;
+  i, j: Integer;
 begin
   for i := 0 to high(FToolbars) do
   begin
@@ -231,30 +231,7 @@ begin
           end;
         end else
         if Controls[j] is TBCComboBox then
-        begin
-          BCAssignSystemStyle(TBCComboBox(Controls[j]).Button, FDarkTheme);
-          with TBCComboBox(Controls[j]) do
-          begin
-            h := FToolbars[i].tb.Height;
-            Button.StateNormal.FontEx.Height := (h-4) div 2;
-            Button.StateNormal.FontEx.ShadowColorOpacity:= 96;
-            Button.StateClicked.FontEx.Height := (h-4) div 2;
-            Button.StateClicked.FontEx.ShadowColorOpacity:= 96;
-            Button.StateHover.FontEx.Height := (h-4) div 2;
-            Button.StateHover.FontEx.ShadowColorOpacity:= 96;
-            if FDarkTheme then
-            begin
-              DropDownBorderColor:= clBlack;
-              DropDownFontColor:= clLightText;
-              DropDownColor:= clDarkBtnFace;
-            end else
-            begin
-              DropDownBorderColor := MergeBGRA(ColorToBGRA(clWindowText),ColorToBGRA(clWindow));
-              DropDownFontColor:= clWindowText;
-              DropDownColor:= clWindow;
-            end;
-          end;
-        end else
+          BCAssignSystemStyle(TBCComboBox(Controls[j]), FDarkTheme, 0.4) else
         if Controls[j] is TBCTrackbarUpdown then
         begin
           if FDarkTheme then