← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2971: forward font changes to trees

 

------------------------------------------------------------
revno: 2971
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2012-06-29 21:50:24 +0200
message:
  forward font changes to trees
modified:
  dwt/src/widgets/Tree.cpp
  win32/DirectoryListingFrame.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/src/widgets/Tree.cpp'
--- dwt/src/widgets/Tree.cpp	2012-06-18 15:29:50 +0000
+++ dwt/src/widgets/Tree.cpp	2012-06-29 19:50:24 +0000
@@ -66,13 +66,18 @@
 
 	onSized([this](const SizedEvent& e) { layout(); });
 
-	/* forward WM_SETREDRAW to the tree control handle. do it with Dispatcher::chain to avoid an
+	/* forward these messages to the tree control handle. do it with Dispatcher::chain to avoid an
 	infinite loop. */
-	onRedrawChanged([this](bool b) -> bool {
-		MSG msg = { treeHandle(), WM_SETREDRAW, b };
-		tree->getDispatcher().chain(msg);
-		return true;
-	});
+	auto forwardMsg = [this](const Message& message) {
+		addCallback(message, [this](const MSG& msg, LRESULT& ret) -> bool {
+			MSG treeMsg = msg;
+			treeMsg.hwnd = treeHandle();
+			ret = tree->getDispatcher().chain(treeMsg);
+			return true;
+		});
+	};
+	forwardMsg(Message(WM_SETFONT));
+	forwardMsg(Message(WM_SETREDRAW));
 
 	tree->onCustomDraw([this](NMTVCUSTOMDRAW& x) { return draw(x); });
 

=== modified file 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp	2012-06-23 12:31:10 +0000
+++ win32/DirectoryListingFrame.cpp	2012-06-29 19:50:24 +0000
@@ -440,6 +440,7 @@
 
 void DirectoryListingFrame::loadFile(const tstring& dir) {
 	setEnabled(false);
+	status->setVisible(false);
 
 	{
 		// this control will cover the whole window.
@@ -457,6 +458,7 @@
 		delete loader;
 		loader = 0;
 
+		status->setVisible(true);
 		setEnabled(true);
 
 		loading->setVisible(false);