mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Removed NativeTransparency option (now always enabled)
This commit is contained in:
parent
174a612c49
commit
8332f8465e
@ -115,7 +115,6 @@ CMeterWindow::CMeterWindow(const std::wstring& config, const std::wstring& iniFi
|
||||
m_WindowStartHidden(false),
|
||||
m_SavePosition(false), // Must be false
|
||||
m_SnapEdges(true),
|
||||
m_NativeTransparency(true),
|
||||
m_AlphaValue(255),
|
||||
m_FadeDuration(250),
|
||||
m_WindowZPosition(ZPOSITION_NORMAL),
|
||||
@ -1794,7 +1793,6 @@ void CMeterWindow::ReadConfig()
|
||||
m_WindowStartHidden = false;
|
||||
m_SavePosition = true;
|
||||
m_SnapEdges = true;
|
||||
m_NativeTransparency = true;
|
||||
m_ClickThrough = false;
|
||||
m_KeepOnScreen = true;
|
||||
m_AutoSelectScreen = false;
|
||||
@ -1835,7 +1833,6 @@ void CMeterWindow::ReadConfig()
|
||||
m_WindowStartHidden = 0!=parser.ReadInt(section, L"StartHidden", m_WindowStartHidden);
|
||||
m_SavePosition = 0!=parser.ReadInt(section, L"SavePosition", m_SavePosition);
|
||||
m_SnapEdges = 0!=parser.ReadInt(section, L"SnapEdges", m_SnapEdges);
|
||||
m_NativeTransparency = 0!=parser.ReadInt(section, L"NativeTransparency", m_NativeTransparency);
|
||||
m_ClickThrough = 0!=parser.ReadInt(section, L"ClickThrough", m_ClickThrough);
|
||||
m_KeepOnScreen = 0!=parser.ReadInt(section, L"KeepOnScreen", m_KeepOnScreen);
|
||||
m_AutoSelectScreen = 0!=parser.ReadInt(section, L"AutoSelectScreen", m_AutoSelectScreen);
|
||||
@ -2442,17 +2439,6 @@ bool CMeterWindow::ResizeWindow(bool reset)
|
||||
m_WindowH = m_Background->GetHeight();
|
||||
//Calculate the window position from the config parameters
|
||||
WindowToScreen();
|
||||
|
||||
if (!m_NativeTransparency)
|
||||
{
|
||||
// Graph the desktop and place the background on top of it
|
||||
Bitmap* desktop = GrabDesktop(m_ScreenX, m_ScreenY, m_WindowW, m_WindowH);
|
||||
Graphics graphics(desktop);
|
||||
Rect r(0, 0, m_WindowW, m_WindowH);
|
||||
graphics.DrawImage(m_Background, r, 0, 0, m_WindowW, m_WindowH, UnitPixel);
|
||||
delete m_Background;
|
||||
m_Background = desktop;
|
||||
}
|
||||
}
|
||||
|
||||
delete tintedBackground;
|
||||
@ -2466,36 +2452,9 @@ bool CMeterWindow::ResizeWindow(bool reset)
|
||||
|
||||
SetWindowSizeVariables(m_WindowW, m_WindowH);
|
||||
|
||||
if (!m_NativeTransparency)
|
||||
{
|
||||
// If Background is not set, take a copy from the desktop
|
||||
if (m_Background == NULL && m_BackgroundMode == BGMODE_COPY)
|
||||
{
|
||||
m_Background = GrabDesktop(m_ScreenX, m_ScreenY, m_WindowW, m_WindowH);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
** Grabs a part of the desktop
|
||||
*/
|
||||
Bitmap* CMeterWindow::GrabDesktop(int x, int y, int w, int h)
|
||||
{
|
||||
HDC desktopDC = GetDC(0);
|
||||
HDC dc = CreateCompatibleDC(desktopDC);
|
||||
HBITMAP desktopBM = CreateCompatibleBitmap(desktopDC, w, h);
|
||||
HBITMAP oldBM = (HBITMAP)SelectObject(dc, desktopBM);
|
||||
BitBlt(dc, 0, 0, w, h, desktopDC, x, y, SRCCOPY);
|
||||
SelectObject(dc, oldBM);
|
||||
DeleteDC(dc);
|
||||
ReleaseDC(0, desktopDC);
|
||||
Bitmap* background = new Bitmap(desktopBM, NULL);
|
||||
DeleteObject(desktopBM);
|
||||
return background;
|
||||
}
|
||||
|
||||
/*
|
||||
** Creates the back buffer bitmap.
|
||||
**
|
||||
@ -2552,7 +2511,7 @@ void CMeterWindow::CreateRegion(bool clear)
|
||||
}
|
||||
}
|
||||
|
||||
SetWindowRgn(m_Window, region, !m_NativeTransparency);
|
||||
SetWindowRgn(m_Window, region, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2668,11 +2627,6 @@ void CMeterWindow::Redraw()
|
||||
}
|
||||
|
||||
UpdateTransparency(m_TransparencyValue, false);
|
||||
|
||||
if (!m_NativeTransparency)
|
||||
{
|
||||
InvalidateRect(m_Window, NULL, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2856,8 +2810,6 @@ void CMeterWindow::Update(bool nodraw)
|
||||
** Updates the native Windows transparency
|
||||
*/
|
||||
void CMeterWindow::UpdateTransparency(int alpha, bool reset)
|
||||
{
|
||||
if (m_NativeTransparency)
|
||||
{
|
||||
if (reset)
|
||||
{
|
||||
@ -2887,14 +2839,6 @@ void CMeterWindow::UpdateTransparency(int alpha, bool reset)
|
||||
|
||||
m_TransparencyValue = alpha;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (reset)
|
||||
{
|
||||
RemoveWindowExStyle(WS_EX_LAYERED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Repaints the window. This does not cause update of the measures.
|
||||
@ -3037,7 +2981,7 @@ LRESULT CMeterWindow::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
void CMeterWindow::FadeWindow(int from, int to)
|
||||
{
|
||||
if (!m_NativeTransparency || m_FadeDuration == 0)
|
||||
if (m_FadeDuration == 0)
|
||||
{
|
||||
if (to == 0)
|
||||
{
|
||||
@ -3321,7 +3265,7 @@ LRESULT CMeterWindow::OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
switch (m_WindowHide)
|
||||
{
|
||||
case HIDEMODE_HIDE:
|
||||
if (!m_NativeTransparency || m_TransparencyValue == m_AlphaValue)
|
||||
if (m_TransparencyValue == m_AlphaValue)
|
||||
{
|
||||
FadeWindow(m_AlphaValue, 0);
|
||||
}
|
||||
@ -4674,8 +4618,6 @@ LRESULT CMeterWindow::OnDelayedRefresh(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
**
|
||||
*/
|
||||
LRESULT CMeterWindow::OnDelayedMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (m_NativeTransparency)
|
||||
{
|
||||
m_Parser.ResetMonitorVariables(this);
|
||||
|
||||
@ -4688,12 +4630,6 @@ LRESULT CMeterWindow::OnDelayedMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
|
||||
SetWindowPos(m_Window, NULL, m_ScreenX, m_ScreenY, m_WindowW, m_WindowH, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// With copy transparency we'll do a full refresh
|
||||
PostMessage(m_Window, WM_METERWINDOW_DELAYED_REFRESH, (WPARAM)NULL, (LPARAM)NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -224,7 +224,6 @@ public:
|
||||
int GetXScreen() { return m_WindowXScreen; }
|
||||
int GetYScreen() { return m_WindowYScreen; }
|
||||
|
||||
bool GetNativeTransparency() { return m_NativeTransparency; }
|
||||
bool GetClickThrough() { return m_ClickThrough; }
|
||||
bool GetKeepOnScreen() { return m_KeepOnScreen; }
|
||||
bool GetAutoSelectScreen() { return m_AutoSelectScreen; }
|
||||
@ -305,7 +304,6 @@ private:
|
||||
|
||||
void CreateRegion(bool clear);
|
||||
void GetSkinFolders(const std::wstring& folder);
|
||||
Gdiplus::Bitmap* GrabDesktop(int x, int y, int w, int h);
|
||||
void SnapToWindow(CMeterWindow* window, LPWINDOWPOS wp);
|
||||
void MapCoordsToScreen(int& x, int& y, int w, int h);
|
||||
void WindowToScreen();
|
||||
@ -410,7 +408,6 @@ private:
|
||||
bool m_WindowStartHidden; // If true, the window is hidden at startup
|
||||
bool m_SavePosition; // If true, the window's position is saved
|
||||
bool m_SnapEdges; // If true, the window snaps to the edges of the screen when moved
|
||||
bool m_NativeTransparency; // If true, use the W2k/XP native transparency
|
||||
int m_AlphaValue; // The 'from' transparency value 0 - 255
|
||||
int m_FadeDuration; // Time it takes to fade the window
|
||||
ZPOSITION m_WindowZPosition; // Window's Z-position
|
||||
|
@ -2836,13 +2836,6 @@ HMENU CRainmeter::CreateSkinMenu(CMeterWindow* meterWindow, int index, HMENU con
|
||||
}
|
||||
|
||||
// Tick the transparency
|
||||
if (!meterWindow->GetNativeTransparency())
|
||||
{
|
||||
EnableMenuItem(settingsMenu, 1, MF_BYPOSITION | MF_GRAYED); // "Transparency" menu
|
||||
EnableMenuItem(settingsMenu, IDM_SKIN_CLICKTHROUGH, MF_BYCOMMAND | MF_GRAYED);
|
||||
}
|
||||
else
|
||||
{
|
||||
HMENU alphaMenu = GetSubMenu(settingsMenu, 1);
|
||||
if (alphaMenu)
|
||||
{
|
||||
@ -2869,7 +2862,6 @@ HMENU CRainmeter::CreateSkinMenu(CMeterWindow* meterWindow, int index, HMENU con
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tick the configs
|
||||
switch (meterWindow->GetWindowHide())
|
||||
|
Loading…
x
Reference in New Issue
Block a user