Browse Source

windows 11 light styles for panel, panel title, panel text, and demo

Leandro Diaz 2 years ago
parent
commit
7fdf2b97a3

+ 115 - 0
styles/windows11-panel-light.bcpnl

@@ -0,0 +1,115 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCPanel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft,akRight
+AutoSize = 0
+Background.Color = 16514043
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 0
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 16777215
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 35
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 0
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 16777215
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsColor
+BevelInner = bvNone
+BevelOuter = bvNone
+BevelWidth = 1
+Border.Color = 15066597
+Border.ColorOpacity = 255
+Border.LightColor = 16777215
+Border.LightOpacity = 255
+Border.LightWidth = 0
+Border.Style = bboSolid
+Border.Width = 1
+BorderBCStyle = bpsBorder
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+ChildSizing.ControlsPerLine = 0
+ChildSizing.EnlargeHorizontal = crsAnchorAligning
+ChildSizing.EnlargeVertical = crsAnchorAligning
+ChildSizing.HorizontalSpacing = 0
+ChildSizing.Layout = cclNone
+ChildSizing.LeftRightSpacing = 0
+ChildSizing.ShrinkHorizontal = crsAnchorAligning
+ChildSizing.ShrinkVertical = crsAnchorAligning
+ChildSizing.TopBottomSpacing = 0
+ChildSizing.VerticalSpacing = 0
+Color = 15987699
+Constraints.MaxHeight = 0
+Constraints.MaxWidth = 0
+Constraints.MinHeight = 0
+Constraints.MinWidth = 0
+Cursor = 0
+DockSite = 0
+DragCursor = -12
+DragKind = dkDrag
+DragMode = dmManual
+Enabled = 1
+FontEx.Color = 536870912
+FontEx.DisabledColor = 536870911
+FontEx.EndEllipsis = 0
+FontEx.FontQuality = fqSystemClearType
+FontEx.Height = 0
+FontEx.Name = default
+FontEx.PaddingBottom = 0
+FontEx.PaddingLeft = 0
+FontEx.PaddingRight = 0
+FontEx.PaddingTop = 0
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = 
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+ParentBackground = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 5
+Rounding.RoundY = 5
+ShowHint = 0
+TabOrder = 0
+TabStop = 0
+Tag = 0
+UseDockManager = 1
+Visible = 1

+ 89 - 0
styles/windows11-panel-text-light.bclbl

@@ -0,0 +1,89 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCLabel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 1
+Background.Color = 0
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 0
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 16777215
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 35
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 0
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 16777215
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsClear
+Border.Color = 0
+Border.ColorOpacity = 255
+Border.LightColor = 16777215
+Border.LightOpacity = 255
+Border.LightWidth = 0
+Border.Style = bboNone
+Border.Width = 1
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Cursor = 0
+Enabled = 1
+FontEx.Color = 6250335
+FontEx.DisabledColor = 536870911
+FontEx.EndEllipsis = 0
+FontEx.FontQuality = fqSystemClearType
+FontEx.Height = 14
+FontEx.Name = default
+FontEx.PaddingBottom = 0
+FontEx.PaddingLeft = 0
+FontEx.PaddingRight = 0
+FontEx.PaddingTop = 0
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = 
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+InnerMargin = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+ShowHint = 0
+Tag = 0
+Visible = 1

+ 89 - 0
styles/windows11-panel-title-light.bclbl

@@ -0,0 +1,89 @@
+[HEADER]
+Author=Me
+Description=
+ControlClass=TBCLabel
+
+[PROPERTIES]
+Align = alNone
+AnchorSideBottom.Side = asrTop
+AnchorSideLeft.Side = asrTop
+AnchorSideRight.Side = asrTop
+AnchorSideTop.Side = asrTop
+Anchors = akTop,akLeft
+AutoSize = 1
+Background.Color = 0
+Background.ColorOpacity = 255
+Background.Gradient1.ColorCorrection = 1
+Background.Gradient1.DrawMode = dmSet
+Background.Gradient1.EndColor = 0
+Background.Gradient1.EndColorOpacity = 255
+Background.Gradient1.GradientType = gtLinear
+Background.Gradient1.Point1XPercent = 0
+Background.Gradient1.Point1YPercent = 0
+Background.Gradient1.Point2XPercent = 0
+Background.Gradient1.Point2YPercent = 100
+Background.Gradient1.Sinus = 0
+Background.Gradient1.StartColor = 16777215
+Background.Gradient1.StartColorOpacity = 255
+Background.Gradient1EndPercent = 35
+Background.Gradient2.ColorCorrection = 1
+Background.Gradient2.DrawMode = dmSet
+Background.Gradient2.EndColor = 0
+Background.Gradient2.EndColorOpacity = 255
+Background.Gradient2.GradientType = gtLinear
+Background.Gradient2.Point1XPercent = 0
+Background.Gradient2.Point1YPercent = 0
+Background.Gradient2.Point2XPercent = 0
+Background.Gradient2.Point2YPercent = 100
+Background.Gradient2.Sinus = 0
+Background.Gradient2.StartColor = 16777215
+Background.Gradient2.StartColorOpacity = 255
+Background.Style = bbsClear
+Border.Color = 0
+Border.ColorOpacity = 255
+Border.LightColor = 16777215
+Border.LightOpacity = 255
+Border.LightWidth = 0
+Border.Style = bboNone
+Border.Width = 1
+BorderSpacing.Around = 0
+BorderSpacing.Bottom = 0
+BorderSpacing.CellAlignHorizontal = ccaFill
+BorderSpacing.CellAlignVertical = ccaFill
+BorderSpacing.InnerBorder = 0
+BorderSpacing.Left = 0
+BorderSpacing.Right = 0
+BorderSpacing.Top = 0
+Cursor = 0
+Enabled = 1
+FontEx.Color = 1776411
+FontEx.DisabledColor = 536870911
+FontEx.EndEllipsis = 0
+FontEx.FontQuality = fqSystemClearType
+FontEx.Height = 20
+FontEx.Name = default
+FontEx.PaddingBottom = 0
+FontEx.PaddingLeft = 0
+FontEx.PaddingRight = 0
+FontEx.PaddingTop = 0
+FontEx.Shadow = 0
+FontEx.ShadowColor = 0
+FontEx.ShadowColorOpacity = 255
+FontEx.ShadowOffsetX = 5
+FontEx.ShadowOffsetY = 5
+FontEx.ShadowRadius = 5
+FontEx.SingleLine = 1
+FontEx.Style = fsBold
+FontEx.TextAlignment = bcaCenter
+FontEx.WordBreak = 0
+HelpContext = 0
+HelpKeyword = 
+HelpType = htContext
+Hint = 
+InnerMargin = 0
+Rounding.RoundOptions = 
+Rounding.RoundX = 1
+Rounding.RoundY = 1
+ShowHint = 0
+Tag = 0
+Visible = 1

+ 123 - 0
test/test_windows_theme/umain.lfm

@@ -0,0 +1,123 @@
+object frmWindowsTheme: TfrmWindowsTheme
+  Left = 63
+  Height = 480
+  Top = 225
+  Width = 848
+  Caption = 'Windows Theme'
+  ClientHeight = 480
+  ClientWidth = 848
+  Color = 15987699
+  DesignTimePPI = 192
+  Position = poScreenCenter
+  LCLVersion = '3.99.0.0'
+  OnCreate = FormCreate
+  object BCPanel1: TBCPanel
+    Left = 16
+    Height = 224
+    Top = 16
+    Width = 816
+    Anchors = [akTop, akLeft, akRight]
+    Background.Color = 16514043
+    Background.Gradient1.StartColor = clWhite
+    Background.Gradient1.EndColor = clBlack
+    Background.Gradient1.GradientType = gtLinear
+    Background.Gradient1.Point1XPercent = 0
+    Background.Gradient1.Point1YPercent = 0
+    Background.Gradient1.Point2XPercent = 0
+    Background.Gradient1.Point2YPercent = 100
+    Background.Gradient2.StartColor = clWhite
+    Background.Gradient2.EndColor = clBlack
+    Background.Gradient2.GradientType = gtLinear
+    Background.Gradient2.Point1XPercent = 0
+    Background.Gradient2.Point1YPercent = 0
+    Background.Gradient2.Point2XPercent = 0
+    Background.Gradient2.Point2YPercent = 100
+    Background.Gradient1EndPercent = 35
+    Background.Style = bbsColor
+    BevelInner = bvNone
+    BevelOuter = bvNone
+    BevelWidth = 1
+    Border.Color = 15066597
+    Border.Style = bboSolid
+    BorderBCStyle = bpsBorder
+    FontEx.Color = clDefault
+    FontEx.FontQuality = fqSystemClearType
+    FontEx.Shadow = False
+    FontEx.ShadowRadius = 5
+    FontEx.ShadowOffsetX = 5
+    FontEx.ShadowOffsetY = 5
+    FontEx.Style = []
+    ParentBackground = False
+    Rounding.RoundX = 5
+    Rounding.RoundY = 5
+    TabOrder = 0
+    object BCLabel1: TBCLabel
+      Left = 48
+      Height = 28
+      Top = 48
+      Width = 267
+      Background.Gradient1.StartColor = clWhite
+      Background.Gradient1.EndColor = clBlack
+      Background.Gradient1.GradientType = gtLinear
+      Background.Gradient1.Point1XPercent = 0
+      Background.Gradient1.Point1YPercent = 0
+      Background.Gradient1.Point2XPercent = 0
+      Background.Gradient1.Point2YPercent = 100
+      Background.Gradient2.StartColor = clWhite
+      Background.Gradient2.EndColor = clBlack
+      Background.Gradient2.GradientType = gtLinear
+      Background.Gradient2.Point1XPercent = 0
+      Background.Gradient2.Point1YPercent = 0
+      Background.Gradient2.Point2XPercent = 0
+      Background.Gradient2.Point2YPercent = 100
+      Background.Gradient1EndPercent = 35
+      Background.Style = bbsClear
+      Border.Style = bboNone
+      Caption = 'Configuración recomendada'
+      FontEx.Color = 1776411
+      FontEx.FontQuality = fqSystemClearType
+      FontEx.Height = 20
+      FontEx.Shadow = False
+      FontEx.ShadowRadius = 5
+      FontEx.ShadowOffsetX = 5
+      FontEx.ShadowOffsetY = 5
+      FontEx.Style = [fsBold]
+      Rounding.RoundX = 1
+      Rounding.RoundY = 1
+    end
+    object BCLabel2: TBCLabel
+      Left = 48
+      Height = 19
+      Top = 128
+      Width = 280
+      Background.Gradient1.StartColor = clWhite
+      Background.Gradient1.EndColor = clBlack
+      Background.Gradient1.GradientType = gtLinear
+      Background.Gradient1.Point1XPercent = 0
+      Background.Gradient1.Point1YPercent = 0
+      Background.Gradient1.Point2XPercent = 0
+      Background.Gradient1.Point2YPercent = 100
+      Background.Gradient2.StartColor = clWhite
+      Background.Gradient2.EndColor = clBlack
+      Background.Gradient2.GradientType = gtLinear
+      Background.Gradient2.Point1XPercent = 0
+      Background.Gradient2.Point1YPercent = 0
+      Background.Gradient2.Point2XPercent = 0
+      Background.Gradient2.Point2YPercent = 100
+      Background.Gradient1EndPercent = 35
+      Background.Style = bbsClear
+      Border.Style = bboNone
+      Caption = 'Configuración reciente y usada habitualmente'
+      FontEx.Color = 6250335
+      FontEx.FontQuality = fqSystemClearType
+      FontEx.Height = 14
+      FontEx.Shadow = False
+      FontEx.ShadowRadius = 5
+      FontEx.ShadowOffsetX = 5
+      FontEx.ShadowOffsetY = 5
+      FontEx.Style = []
+      Rounding.RoundX = 1
+      Rounding.RoundY = 1
+    end
+  end
+end

+ 42 - 0
test/test_windows_theme/umain.pas

@@ -0,0 +1,42 @@
+unit umain;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, BCPanel, BCLabel;
+
+type
+
+  { TfrmWindowsTheme }
+
+  TfrmWindowsTheme = class(TForm)
+    BCLabel1: TBCLabel;
+    BCLabel2: TBCLabel;
+    BCPanel1: TBCPanel;
+    procedure FormCreate(Sender: TObject);
+  private
+
+  public
+
+  end;
+
+var
+  frmWindowsTheme: TfrmWindowsTheme;
+
+implementation
+
+{$R *.lfm}
+
+{ TfrmWindowsTheme }
+
+procedure TfrmWindowsTheme.FormCreate(Sender: TObject);
+begin
+  BCLabel1.FontEx.Height := ScaleY(BCLabel1.FontEx.Height, 96);
+  BCLabel2.FontEx.Height := ScaleY(BCLabel2.FontEx.Height, 96);
+  BCPanel1.Border.Width := ScaleY(BCPanel1.Border.Width, 96);
+end;
+
+end.
+

BIN
test/test_windows_theme/windowstheme.ico


+ 140 - 0
test/test_windows_theme/windowstheme.lpi

@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="windowstheme"/>
+      <Scaled Value="True"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+    </General>
+    <BuildModes>
+      <Item Name="Debug" Default="True"/>
+      <Item Name="Release">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="windowstheme"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+              <RunWithoutDebug Value="True"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+          <Other>
+            <ConfigFile>
+              <WriteConfigFilePath Value=""/>
+            </ConfigFile>
+          </Other>
+        </CompilerOptions>
+      </Item>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <RequiredPackages>
+      <Item>
+        <PackageName Value="bgracontrols"/>
+      </Item>
+      <Item>
+        <PackageName Value="LCL"/>
+      </Item>
+    </RequiredPackages>
+    <Units>
+      <Unit>
+        <Filename Value="windowstheme.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="umain.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="frmWindowsTheme"/>
+        <HasResources Value="True"/>
+        <ResourceBaseClass Value="Form"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="windowstheme"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Parsing>
+      <SyntaxOptions>
+        <IncludeAssertionCode Value="True"/>
+      </SyntaxOptions>
+    </Parsing>
+    <CodeGeneration>
+      <Checks>
+        <IOChecks Value="True"/>
+        <RangeChecks Value="True"/>
+        <OverflowChecks Value="True"/>
+        <StackChecks Value="True"/>
+      </Checks>
+      <VerifyObjMethodCallValidity Value="True"/>
+    </CodeGeneration>
+    <Linking>
+      <Debugging>
+        <DebugInfoType Value="dsDwarf3"/>
+        <UseHeaptrc Value="True"/>
+        <TrashVariables Value="True"/>
+        <UseExternalDbgSyms Value="True"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+    <Other>
+      <ConfigFile>
+        <WriteConfigFilePath Value=""/>
+      </ConfigFile>
+    </Other>
+  </CompilerOptions>
+  <Debugging>
+    <Exceptions>
+      <Item>
+        <Name Value="EAbort"/>
+      </Item>
+      <Item>
+        <Name Value="ECodetoolError"/>
+      </Item>
+      <Item>
+        <Name Value="EFOpenError"/>
+      </Item>
+    </Exceptions>
+  </Debugging>
+</CONFIG>

+ 25 - 0
test/test_windows_theme/windowstheme.lpr

@@ -0,0 +1,25 @@
+program windowstheme;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}
+  cthreads,
+  {$ENDIF}
+  {$IFDEF HASAMIGA}
+  athreads,
+  {$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, umain
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource:=True;
+  Application.Scaled:=True;
+  Application.Initialize;
+  Application.CreateForm(TfrmWindowsTheme, frmWindowsTheme);
+  Application.Run;
+end.
+