Official eMule-Board: Minor Theming Issues - Official eMule-Board

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Minor Theming Issues

#1 User is offline   tHeWiZaRdOfDoS 

  • He's MaGiC
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4680
  • Joined: 28-December 02

Posted 01 November 2009 - 07:09 AM

I just came across some smaller issues with the theming that is used in eMule, so I wanted to tell you about it:
In eMule.cpp, we have these functions:

Quote

bool CemuleApp::IsXPThemeActive() const
{
// TRUE: If an XP style (and only an XP style) is active
return theApp.m_ullComCtrlVer < MAKEDLLVERULL(6,16,0,0) && g_xpStyle.IsThemeActive() && g_xpStyle.IsAppThemed();
}

bool CemuleApp::IsVistaThemeActive() const
{
// TRUE: If a Vista (or better) style is active
return theApp.m_ullComCtrlVer >= MAKEDLLVERULL(6,16,0,0) && g_xpStyle.IsThemeActive() && g_xpStyle.IsAppThemed();
}

which are called in several places to changed the style correspondingly to the theme that is used.
However, these settings are *NOT* changed if the style changes while eMule is running!

E.g. @CClosableTabCtrl::InternalInit() and the main tabctrl in transferwnd:

Quote

if (theApp.IsVistaThemeActive())
m_dlTab.ModifyStyle(0, WS_CLIPCHILDREN);


Also, @CButtonsTabCtrl:

Quote

void CButtonsTabCtrl::InternalInit()
{
if (theApp.IsVistaThemeActive()) {
ModifyStyle(0, TCS_OWNERDRAWFIXED);
ModifyStyle(0, TCS_HOTTRACK);
}
}

LRESULT CButtonsTabCtrl::_OnThemeChanged()
{
// Owner drawn tab control seems to have troubles with updating itself due to an XP theme change..
bool bIsOwnerDrawn = (GetStyle() & TCS_OWNERDRAWFIXED) != 0;
if (bIsOwnerDrawn)
ModifyStyle(TCS_OWNERDRAWFIXED, 0); // Reset control style to not-owner drawn
Default(); // Process original WM_THEMECHANGED message
if (bIsOwnerDrawn)
ModifyStyle(0, TCS_OWNERDRAWFIXED); // Apply owner drawn style again
return 0;
}

we should check if theApp.IsVistaThemeActive() is still true, otherwise, we shouldn't set the styles again, or am I wrong here again? :flowers:

Best regards,
WiZ

Start into eMuleFuture now! Successor to my TS - includes all of its features and much more!

* New age leecher detection via ClientAnalyzer heuristics! Never needs an update and punishes only clients which really behave badly.
* Powersharing, automatic and global hardlimit, real full chunk transfers, DBR system, IntelliFlush and much more... increase the efficiency of both uploaders and downloaders
* improved GUI and display options, e.g. let eMuleFuture show a flag in front of your files to display where most of the sources of that file come from...

There is so much more! Start now!



This post has been edited 937 times, the last time by tHeWiZaRdOfDoS: Today, 12:27 PM
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users