From: poy <po...@12...> - 2008-02-06 14:30:00
|
this (big) patch adds icons in the main menu of DC++. "and more": the menu has a nice style with borders, shadows, etc. :) i used WidgetMenuExtended, which i had to "port" from "vanilla SmartWin" to "DC++'s SmartWin", which means i did *a lot* of changes everywhere in the class (simplify template args, use seeds, change the way messages are dispatched and caught, and many other small fixes to make it compile and run fine...). the file is huge so there may still be fixes left to be done, but overall it's now consistent with the rest of the SmartWin classes used in DC++. i pasted most fixes from WidgetMenu; there is, however, one important difference between WidgetMenu and WidgetMenuExtended: while the former doesn't require any parent, the latter must have one in order to catch custom draw messages (and that parent is used for some more stuff during painting, too). unlike usual command bars that use image lists, WidgetMenuExtended requires single bitmaps for each command, so i sliced toolbar.bmp into 16pixels parts. all these parts are in the folder res/menu. WidgetMenuExtended allows for more than the bitmap to be changed (text color, bg color, etc can be changed too), but we only change the bitmap in the DC++ main menu so i overloaded the WidgetMenuExtended::appendItem function to accept bitmaps directly. added files: smartwin/source/widgets/WidgetMenuExtended.cpp the folder res/menu which contains 16 bitmaps, all included in the rar file. deleted: res/toolbar.bmp attached is a screenshot of the result. all previous icons that were in the WTL version of DC++ have been added, but there are still some commands that are icon-less; new icons are welcome. ;) (icons, actually bitmaps, have to be 16x16 bmp files that use RGB(255, 0, 255) (full red, no green, full blue) as their background color; that color will render as transparent in DC++.) poy |
From: Jacek S. <arn...@gm...> - 2008-02-07 22:56:06
|
Let's hope this is wine compatible =) On a more serious note; I wonder what this does to the blind - from what I gather there are actually blind people using dc++ and they were more than happy with the new menus since they're better for their screen readers...let's hope this patch doesn't interfere... Also, at some point, for consistency, all right-click menus should probably be moved to this fancy stuff as well (commit directly if you feel like doing this...) Would the transparency settings for bitmaps be better off in the seed? Does it take its default menu colors from the system that it'll blend in? To fix: smartwin/source/widgets/../../include/smartwin/widgets/WidgetMenuExtended.h: In constructor 'SmartWin::WidgetMenuExtended::WidgetMenuExtended(SmartWin::Widget*)': smartwin/source/widgets/../../include/smartwin/widgets/WidgetMenuExtended.h:501: warning: 'SmartWin::WidgetMenuExtended::drawSidebar' will be initialized after smartwin/source/widgets/../../include/smartwin/widgets/WidgetMenuExtended.h:498: warning: 'SmartWin::FontPtr SmartWin::WidgetMenuExtended::itsTitleFont' smartwin/source/widgets/WidgetMenuExtended.cpp:872: warning: when initialized here /J poy wrote: > this (big) patch adds icons in the main menu of DC++. "and more": the > menu has a nice style with borders, shadows, etc. :) > > i used WidgetMenuExtended, which i had to "port" from "vanilla SmartWin" > to "DC++'s SmartWin", which means i did *a lot* of changes everywhere in > the class (simplify template args, use seeds, change the way messages > are dispatched and caught, and many other small fixes to make it compile > and run fine...). > the file is huge so there may still be fixes left to be done, but > overall it's now consistent with the rest of the SmartWin classes used > in DC++. i pasted most fixes from WidgetMenu; there is, however, one > important difference between WidgetMenu and WidgetMenuExtended: while > the former doesn't require any parent, the latter must have one in order > to catch custom draw messages (and that parent is used for some more > stuff during painting, too). > > unlike usual command bars that use image lists, WidgetMenuExtended > requires single bitmaps for each command, so i sliced toolbar.bmp into > 16pixels parts. all these parts are in the folder res/menu. > > WidgetMenuExtended allows for more than the bitmap to be changed (text > color, bg color, etc can be changed too), but we only change the bitmap > in the DC++ main menu so i overloaded the WidgetMenuExtended::appendItem > function to accept bitmaps directly. > > added files: > smartwin/source/widgets/WidgetMenuExtended.cpp > the folder res/menu which contains 16 bitmaps, all included in the rar > file. > > deleted: > res/toolbar.bmp > > attached is a screenshot of the result. all previous icons that were in > the WTL version of DC++ have been added, but there are still some > commands that are icon-less; new icons are welcome. ;) > (icons, actually bitmaps, have to be 16x16 bmp files that use RGB(255, > 0, 255) (full red, no green, full blue) as their background color; that > color will render as transparent in DC++.) > > poy > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > dcplusplus-devel mailing list > dcp...@li... > https://lists.sourceforge.net/lists/listinfo/dcplusplus-devel |
From: poy <po...@12...> - 2008-02-08 03:20:36
|
> Let's hope this is wine compatible =) you tell me... ^^ > On a more serious note; I wonder what this does to the blind - from what I > gather there are actually > blind people using dc++ and they were more than happy with the new menus > since they're better for > their screen readers...let's hope this patch doesn't interfere... this still uses standard Windows menus, and adds the text just as in usual menus: info.dwTypeData = const_cast< LPTSTR >( text.c_str() ); on line 802 of WidgetMenuExtended.cpp; only difference is that the menus are custom drawn. hopefully that won't be a problem for these programs... > Also, at some point, for consistency, all right-click menus should > probably be moved to this fancy > stuff as well (commit directly if you feel like doing this...) i've thought about this, yep. :) > Would the transparency settings for bitmaps be better off in the seed? yes, the MenuColorInfo info can now be set through the Seed. also, popup menus appended to a WidgetMenuExtended will now use the same default color settings as their parent. > Does it take its default menu colors from the system that it'll blend in? good question. fortunately, yes, it does (in the MenuItemData and MenuColorInfo constructors). :) > To fix: > smartwin/source/widgets/../../include/smartwin/widgets/WidgetMenuExtended.h: > In constructor > 'SmartWin::WidgetMenuExtended::WidgetMenuExtended(SmartWin::Widget*)': > smartwin/source/widgets/../../include/smartwin/widgets/WidgetMenuExtended.h:501: > warning: > 'SmartWin::WidgetMenuExtended::drawSidebar' will be initialized after > smartwin/source/widgets/../../include/smartwin/widgets/WidgetMenuExtended.h:498: > warning: > 'SmartWin::FontPtr SmartWin::WidgetMenuExtended::itsTitleFont' > smartwin/source/widgets/WidgetMenuExtended.cpp:872: warning: when > initialized here fixed. i don't understand why the warning, though; could initializing a class member before another be a problem, just because they were declared in the reversed order? poy |