alpha-blend hidden notification icons

svn path=/trunk/; revision=11734
This commit is contained in:
Martin Fuchs
2004-11-21 10:53:55 +00:00
parent d69a931982
commit 375d7004a4
7 changed files with 29 additions and 12 deletions
+2 -1
View File
@@ -43,7 +43,7 @@ exe explorer :
dialogs/searchprogram.cpp
dialogs/settings.cpp
i386-stub-win32.c
: <define>WIN32 <define>_WIN32_IE=0x0600 <define>_WIN32_WINNT=0x0501
: <define>WIN32 <define>_WIN32_IE=0x0600 <define>_WIN32_WINNT=0x0501 <define>WINVER=0x0500
<cxxflags>-I$(INCLUDE)
#nur für GCC: <cxxflags>-fexceptions <cxxflags>-Wall
<find-shared-library>gdi32
@@ -52,6 +52,7 @@ exe explorer :
<find-shared-library>uuid
<find-shared-library>wsock32
<find-shared-library>oleaut32
<find-shared-library>msimg32
# <find-shared-library>expat
<linkflags>notifyhook.dll
<linkflags>libexpat.dll
+4 -3
View File
@@ -10,13 +10,14 @@ TARGET_APPTYPE := windows
TARGET_NAME := explorer
TARGET_INSTALLDIR := .
TARGET_CFLAGS := \
-D__USE_W32API -DWIN32 -D_ROS_ -D_WIN32_IE=0x0600 \
-D_WIN32_WINNT=0x0501 -DUNICODE -fexceptions -Wall
-D__USE_W32API -DWIN32 -D_ROS_ \
-D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 \
-DUNICODE -fexceptions -Wall
TARGET_CPPFLAGS := $(TARGET_CFLAGS)
TARGET_RCFLAGS := -D__USE_W32API -DWIN32 -D_ROS_ -D__WINDRES__
TARGET_SDKLIBS := \
gdi32.a comctl32.a ole32.a oleaut32.a shell32.a libexpat.a \
notifyhook.a ws2_32.a
notifyhook.a ws2_32.a msimg32.a
TARGET_GCCLIBS := stdc++ uuid
TARGET_OBJECTS := \
explorer.o \
@@ -8,7 +8,7 @@ CC = gcc
CXX = g++
LINK = g++
CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -fexceptions -Wall -I.
CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -I.
RCFLAGS = -DWIN32 -D__WINDRES__
LFLAGS = -Wl,--subsystem,windows
@@ -75,7 +75,7 @@ OBJECTS = \
i386-stub-win32.o \
xmlstorage.o
LIBS = gdi32 comctl32 ole32 uuid
LIBS = gdi32 comctl32 msimg32 ole32 uuid
DELAYIMPORTS = oleaut32 wsock32
all: $(TARGET)
+2 -2
View File
@@ -10,7 +10,7 @@ CC = gcc
CXX = g++
LINK = g++
CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -fexceptions -Wall -I.
CFLAGS = -DWIN32 -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -fexceptions -Wall -I.
RCFLAGS = -DWIN32 -D__WINDRES__
LFLAGS = -Wl,--subsystem,windows
@@ -77,7 +77,7 @@ OBJECTS = \
i386-stub-win32.o \
xmlstorage.o
LIBS = gdi32 comctl32 ole32 uuid
LIBS = gdi32 comctl32 msimg32 ole32 uuid
DELAYIMPORTS = oleaut32 wsock32
all: precomp.h.gch $(TARGET)
+2 -2
View File
@@ -4,8 +4,8 @@ SRCDIR = .
MODULE = explorer.exe
APPMODE = gui
IMPORTS = shell32 comctl32 ole32 user32 gdi32 kernel32 advapi32 oleaut32
EXTRADEFS = -D__WINE__ -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -D__MINGW32__
IMPORTS = shell32 comctl32 msimg32 ole32 user32 gdi32 kernel32 advapi32 oleaut32
EXTRADEFS = -D__WINE__ -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -D__MINGW32__
EXTRA_OBJS = notifyhook.dll libexpat.dll
EXTRALIBS = $(LIBUUID)
@@ -1,4 +1,4 @@
You will find only major changes in this file.
0You will find only major changes in this file.
Small bug fixes and developments steps are not listet here.
If you search for more information, look into the CVS repository.
@@ -91,3 +91,4 @@ If you search for more information, look into the CVS repository.
23.09.2004 m. fuchs configuration dialog to choose between MDI and SDI mode with persistent storage
20.11.2004 m. fuchs display notification icon change times
notification area button to toggle hidden icons
21.11.2004 m. fuchs alpha-blend hidden notification icons
@@ -635,6 +635,10 @@ void NotifyArea::UpdateIcons()
UpdateWindow(_hwnd);
}
#ifdef _MSC_VER
#pragma comment(lib, "msimg32") // for AlphaBlend()
#endif
void NotifyArea::Paint()
{
BufferedPaintCanvas canvas(_hwnd);
@@ -654,8 +658,18 @@ void NotifyArea::Paint()
x += NOTIFYICON_DIST;
}
MemCanvas mem_dc;
SelectedBitmap bmp(mem_dc, CreateCompatibleBitmap(canvas, NOTIFYICON_SIZE, NOTIFYICON_SIZE));
RECT rect = {0, 0, NOTIFYICON_SIZE, NOTIFYICON_SIZE};
BLENDFUNCTION blend = {AC_SRC_OVER, 0, 128, 0};
for(NotifyIconSet::const_iterator it=_sorted_icons.begin(); it!=_sorted_icons.end(); ++it) {
DrawIconEx(canvas, x, y, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
if (it->_dwState & NIS_HIDDEN) {
FillRect(mem_dc, &rect, GetSysColorBrush(COLOR_BTNFACE));
DrawIconEx(mem_dc, 0, 0, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
AlphaBlend(canvas, x, y, NOTIFYICON_SIZE, NOTIFYICON_SIZE, mem_dc, 0, 0, NOTIFYICON_SIZE, NOTIFYICON_SIZE, blend);
} else
DrawIconEx(canvas, x, y, it->_hIcon, NOTIFYICON_SIZE, NOTIFYICON_SIZE, 0, 0, DI_NORMAL);
x += NOTIFYICON_DIST;
}