mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 22:21:23 +12:00
Show image size and file name in title bar
This commit is contained in:
parent
eb7992e36d
commit
e64135f94d
|
@ -143,16 +143,7 @@ private void InitializeComponent()
|
||||||
SetDefaultCursor();
|
SetDefaultCursor();
|
||||||
Icon = ShareXResources.Icon;
|
Icon = ShareXResources.Icon;
|
||||||
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
|
SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
|
||||||
|
UpdateTitle();
|
||||||
if (IsEditorMode)
|
|
||||||
{
|
|
||||||
Text = "ShareX - " + Resources.RegionCaptureForm_InitializeComponent_ImageEditor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Text = "ShareX - " + Resources.BaseRegionForm_InitializeComponent_Region_capture;
|
|
||||||
}
|
|
||||||
|
|
||||||
StartPosition = FormStartPosition.Manual;
|
StartPosition = FormStartPosition.Manual;
|
||||||
|
|
||||||
if (IsFullscreen)
|
if (IsFullscreen)
|
||||||
|
@ -204,6 +195,34 @@ private void InitializeComponent()
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UpdateTitle()
|
||||||
|
{
|
||||||
|
string text;
|
||||||
|
|
||||||
|
if (IsEditorMode)
|
||||||
|
{
|
||||||
|
text = "ShareX - " + Resources.RegionCaptureForm_InitializeComponent_ImageEditor;
|
||||||
|
|
||||||
|
if (Image != null)
|
||||||
|
{
|
||||||
|
text += $" - {Image.Width}x{Image.Height}";
|
||||||
|
}
|
||||||
|
|
||||||
|
string filename = Helpers.GetFilenameSafe(ImageFilePath);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(filename))
|
||||||
|
{
|
||||||
|
text += " - " + filename;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
text = "ShareX - " + Resources.BaseRegionForm_InitializeComponent_Region_capture;
|
||||||
|
}
|
||||||
|
|
||||||
|
Text = text;
|
||||||
|
}
|
||||||
|
|
||||||
public void Prepare()
|
public void Prepare()
|
||||||
{
|
{
|
||||||
Prepare(new Screenshot().CaptureFullscreen());
|
Prepare(new Screenshot().CaptureFullscreen());
|
||||||
|
@ -242,6 +261,8 @@ internal void InitBackground(Image img)
|
||||||
|
|
||||||
if (IsEditorMode)
|
if (IsEditorMode)
|
||||||
{
|
{
|
||||||
|
UpdateTitle();
|
||||||
|
|
||||||
CanvasRectangle = new Rectangle(CanvasRectangle.X, CanvasRectangle.Y, Image.Width, Image.Height);
|
CanvasRectangle = new Rectangle(CanvasRectangle.X, CanvasRectangle.Y, Image.Width, Image.Height);
|
||||||
|
|
||||||
using (Bitmap background = new Bitmap(Image.Width, Image.Height))
|
using (Bitmap background = new Bitmap(Image.Width, Image.Height))
|
||||||
|
|
Loading…
Reference in a new issue