mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-02 23:35:29 +00:00
Fixed Issue 137.
This commit is contained in:
@@ -139,6 +139,15 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event MouseEventHandler MouseDoubleClick {
|
||||||
|
add {
|
||||||
|
window.MouseDoubleClick += value;
|
||||||
|
}
|
||||||
|
remove {
|
||||||
|
window.MouseDoubleClick -= value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void CreateBuffer() {
|
private void CreateBuffer() {
|
||||||
this.buffer = new Bitmap(window.Size.Width, window.Size.Height,
|
this.buffer = new Bitmap(window.Size.Width, window.Size.Height,
|
||||||
PixelFormat.Format32bppArgb);
|
PixelFormat.Format32bppArgb);
|
||||||
|
@@ -132,6 +132,11 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case WM_NCLBUTTONDBLCLK: {
|
case WM_NCLBUTTONDBLCLK: {
|
||||||
|
if (MouseDoubleClick != null) {
|
||||||
|
MouseDoubleClick(this, new MouseEventArgs(MouseButtons.Left, 2,
|
||||||
|
Macros.GET_X_LPARAM(message.LParam) - location.X,
|
||||||
|
Macros.GET_Y_LPARAM(message.LParam) - location.Y, 0));
|
||||||
|
}
|
||||||
message.Result = IntPtr.Zero;
|
message.Result = IntPtr.Zero;
|
||||||
} break;
|
} break;
|
||||||
case WM_NCRBUTTONDOWN: {
|
case WM_NCRBUTTONDOWN: {
|
||||||
@@ -360,6 +365,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
|
|
||||||
public event HitTestEventHandler HitTest;
|
public event HitTestEventHandler HitTest;
|
||||||
|
|
||||||
|
public event MouseEventHandler MouseDoubleClick;
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
private struct BlendFunction {
|
private struct BlendFunction {
|
||||||
public byte BlendOp;
|
public byte BlendOp;
|
||||||
|
@@ -129,6 +129,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
minCloseMenuItem.Visible = false;
|
minCloseMenuItem.Visible = false;
|
||||||
} else { // Windows
|
} else { // Windows
|
||||||
gadget = new SensorGadget(computer, settings, unitManager);
|
gadget = new SensorGadget(computer, settings, unitManager);
|
||||||
|
gadget.HideShowCommand += hideShowClick;
|
||||||
|
|
||||||
wmiProvider = new WmiProvider(computer);
|
wmiProvider = new WmiProvider(computer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -194,6 +194,10 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
settings.SetValue("sensorGadget.Width", Size.Width);
|
settings.SetValue("sensorGadget.Width", Size.Width);
|
||||||
Redraw();
|
Redraw();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MouseDoubleClick += delegate(object obj, MouseEventArgs args) {
|
||||||
|
SendHideShowCommand();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose() {
|
public override void Dispose() {
|
||||||
@@ -304,6 +308,13 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
Resize();
|
Resize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event EventHandler HideShowCommand;
|
||||||
|
|
||||||
|
public void SendHideShowCommand() {
|
||||||
|
if (HideShowCommand != null)
|
||||||
|
HideShowCommand(this, null);
|
||||||
|
}
|
||||||
|
|
||||||
private Font CreateFont(float size, FontStyle style) {
|
private Font CreateFont(float size, FontStyle style) {
|
||||||
try {
|
try {
|
||||||
return new Font(SystemFonts.MessageBoxFont.FontFamily, size, style);
|
return new Font(SystemFonts.MessageBoxFont.FontFamily, size, style);
|
||||||
|
Reference in New Issue
Block a user