← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2465: keep the Find button pressed when the search bar is in view

 

------------------------------------------------------------
revno: 2465
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sat 2011-03-19 15:51:42 +0100
message:
  keep the Find button pressed when the search bar is in view
modified:
  win32/DirectoryListingFrame.cpp
  win32/DirectoryListingFrame.h


--
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 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp	2011-03-19 13:02:45 +0000
+++ win32/DirectoryListingFrame.cpp	2011-03-19 14:51:42 +0000
@@ -289,10 +289,14 @@
 		ToolBarPtr toolbar = addChild(seed);
 
 		StringList ids;
-		auto addButton = [&toolbar, &ids](unsigned icon, const tstring& text, bool showText, unsigned helpId, const dwt::Dispatchers::VoidVoid<>::F& f) {
+		auto addButton = [&toolbar, &ids](unsigned icon, const tstring& text, bool showText,
+			unsigned helpId, const dwt::Dispatchers::VoidVoid<>::F& f) -> string
+		{
 			ids.push_back(std::string(1, '0' + ids.size()));
 			toolbar->addButton(ids.back(), icon ? WinUtil::toolbarIcon(icon) : 0, 0, text, showText, helpId, f);
+			return ids.back();
 		};
+
 		addButton(IDI_LEFT, T_("Back"), false, IDH_FILE_LIST_BACK, [this] { back(); });
 		addButton(IDI_RIGHT, T_("Forward"), false, IDH_FILE_LIST_FORWARD, [this] { this->forward(); }); // explicit ns (vs std::forward)
 		ids.push_back(string());
@@ -316,10 +320,12 @@
 		ids.clear();
 		addButton(0, T_("Subtract list"), true, IDH_FILE_LIST_SUBSTRACT, [this] { handleListDiff(); });
 		addButton(0, T_("Match queue"), true, IDH_FILE_LIST_MATCH_QUEUE, [this] { handleMatchQueue(); });
-		addButton(IDI_SEARCH, T_("Find") + _T(" \u2207") /* down arrow */, true, IDH_FILE_LIST_FIND, [this] { handleFindToggle(); });
+		auto findId = addButton(IDI_SEARCH, T_("Find") + _T(" \u2207") /* down arrow */, true, IDH_FILE_LIST_FIND, [this] { handleFindToggle(); });
 		toolbar->setLayout(ids);
 
 		rebar->add(toolbar, RBBS_NOGRIPPER);
+
+		searchGrid->onEnabled([toolbar, findId](bool b) { toolbar->setButtonChecked(findId, b); });
 	}
 
 	initStatus();

=== modified file 'win32/DirectoryListingFrame.h'
--- win32/DirectoryListingFrame.h	2011-03-18 21:48:06 +0000
+++ win32/DirectoryListingFrame.h	2011-03-19 14:51:42 +0000
@@ -260,8 +260,6 @@
 	void back();
 	void forward();
 
-	void refresh();
-
 	void initStatusText();
 	void updateStatus();