mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Support light theme in thumbnail view
This commit is contained in:
parent
fa75500b8d
commit
60ee08f04e
4 changed files with 52 additions and 8 deletions
|
@ -195,7 +195,11 @@ private void DrawText(Graphics g)
|
|||
tff |= TextFormatFlags.EndEllipsis;
|
||||
}
|
||||
|
||||
TextRenderer.DrawText(g, Text, Font, ClientRectangle.LocationOffset(0, 1), TextShadowColor, tff);
|
||||
if (TextShadowColor.A > 0)
|
||||
{
|
||||
TextRenderer.DrawText(g, Text, Font, ClientRectangle.LocationOffset(0, 1), TextShadowColor, tff);
|
||||
}
|
||||
|
||||
TextRenderer.DrawText(g, Text, Font, ClientRectangle, ForeColor, tff);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,13 +137,29 @@ public bool ProgressVisible
|
|||
|
||||
public TaskPanel(WorkerTask task)
|
||||
{
|
||||
InitializeComponent();
|
||||
lblFilename.ForeColor = ShareXResources.DarkTextColor;
|
||||
|
||||
Task = task;
|
||||
|
||||
InitializeComponent();
|
||||
UpdateTheme();
|
||||
UpdateFilename();
|
||||
}
|
||||
|
||||
public void UpdateTheme()
|
||||
{
|
||||
if (ShareXResources.UseDarkTheme)
|
||||
{
|
||||
lblFilename.ForeColor = ShareXResources.DarkTextColor;
|
||||
lblFilename.TextShadowColor = Color.Black;
|
||||
pThumbnail.PanelColor = ShareXResources.DarkBorderColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblFilename.ForeColor = SystemColors.WindowText;
|
||||
lblFilename.TextShadowColor = Color.Transparent;
|
||||
pThumbnail.PanelColor = SystemColors.ControlLight;
|
||||
}
|
||||
}
|
||||
|
||||
public void ChangeThumbnailSize(Size size)
|
||||
{
|
||||
ThumbnailSize = size;
|
||||
|
|
|
@ -23,6 +23,7 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
@ -41,9 +42,10 @@ public partial class TaskView : UserControl
|
|||
|
||||
public TaskView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TaskPanels = new List<TaskPanel>();
|
||||
|
||||
InitializeComponent();
|
||||
UpdateTheme();
|
||||
}
|
||||
|
||||
protected override Point ScrollToControl(Control activeControl)
|
||||
|
@ -51,6 +53,23 @@ protected override Point ScrollToControl(Control activeControl)
|
|||
return AutoScrollPosition;
|
||||
}
|
||||
|
||||
public void UpdateTheme()
|
||||
{
|
||||
if (ShareXResources.UseDarkTheme)
|
||||
{
|
||||
BackColor = ShareXResources.DarkBackgroundColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
BackColor = SystemColors.Window;
|
||||
}
|
||||
|
||||
foreach (TaskPanel panel in TaskPanels)
|
||||
{
|
||||
panel.UpdateTheme();
|
||||
}
|
||||
}
|
||||
|
||||
public TaskPanel FindPanel(WorkerTask task)
|
||||
{
|
||||
return TaskPanels.FirstOrDefault(x => x.Task == task);
|
||||
|
|
|
@ -779,7 +779,8 @@ private void UpdateTheme()
|
|||
lblListViewTip.ForeColor = ShareXResources.DarkTextColor;
|
||||
scMain.SplitterColor = ShareXResources.DarkBackgroundColor;
|
||||
scMain.SplitterLineColor = ShareXResources.DarkBorderColor;
|
||||
pbPreview.UpdateCheckers(true);
|
||||
pThumbnailView.BackColor = ShareXResources.DarkBackgroundColor;
|
||||
lblThumbnailViewTip.ForeColor = ShareXResources.DarkTextColor;
|
||||
flpCommunity.BackColor = ShareXResources.DarkBackgroundColor;
|
||||
}
|
||||
else
|
||||
|
@ -793,9 +794,13 @@ private void UpdateTheme()
|
|||
lblListViewTip.ForeColor = Color.Silver;
|
||||
scMain.SplitterColor = Color.White;
|
||||
scMain.SplitterLineColor = ProfessionalColors.SeparatorDark;
|
||||
pbPreview.UpdateCheckers(true);
|
||||
pThumbnailView.BackColor = SystemColors.Window;
|
||||
lblThumbnailViewTip.ForeColor = Color.Silver;
|
||||
flpCommunity.BackColor = SystemColors.Window;
|
||||
}
|
||||
|
||||
pbPreview.UpdateCheckers(true);
|
||||
ucTaskView.UpdateTheme();
|
||||
}
|
||||
|
||||
private void CleanCustomClipboardFormats()
|
||||
|
|
Loading…
Reference in a new issue