← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2193: tab touch-ups

 

------------------------------------------------------------
revno: 2193
committer: poy <poy@xxxxxxxxxx>
branch nick: repo
timestamp: Sat 2010-08-07 16:25:29 +0200
message:
  tab touch-ups
modified:
  dcpp/SettingsManager.cpp
  dwt/src/widgets/TabView.cpp
  help/settings_tabs.html
  win32/TabsPage.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 'dcpp/SettingsManager.cpp'
--- dcpp/SettingsManager.cpp	2010-08-06 21:02:04 +0000
+++ dcpp/SettingsManager.cpp	2010-08-07 14:25:29 +0000
@@ -70,7 +70,7 @@
 	"ShowToolbar", "ShowTransferview", "PopunderPm", "PopunderFilelist", "MagnetAsk", "MagnetAction", "MagnetRegister",
 	"AddFinishedInstantly", "DontDLAlreadyShared", "UseCTRLForLineHistory",
 	"OpenNewWindow", "UDPPort", "HubLastLogLines", "PMLastLogLines",
-	"AdcDebug", "ToggleActiveWindow", "SearchHistory", "SetMinislotSize", "MaxFilelistSize",
+	"AdcDebug", "ToggleActiveTab", "SearchHistory", "SetMinislotSize", "MaxFilelistSize",
 	"HighestPrioSize", "HighPrioSize", "NormalPrioSize", "LowPrioSize", "LowestPrio",
 	"AutoDropSpeed", "AutoDropInterval", "AutoDropElapsed", "AutoDropInactivity", "AutoDropMinSources", "AutoDropFilesize",
 	"AutoDropAll", "AutoDropFilelists", "AutoDropDisconnect",
@@ -225,7 +225,7 @@
 	setDefault(HUB_LAST_LOG_LINES, 10);
 	setDefault(PM_LAST_LOG_LINES, 10);
 	setDefault(ADC_DEBUG, false);
-	setDefault(TOGGLE_ACTIVE_WINDOW, true);
+	setDefault(TOGGLE_ACTIVE_WINDOW, false);
 	setDefault(SEARCH_HISTORY, 10);
 	setDefault(SET_MINISLOT_SIZE, 64);
 	setDefault(MAX_FILELIST_SIZE, 256);

=== modified file 'dwt/src/widgets/TabView.cpp'
--- dwt/src/widgets/TabView.cpp	2010-08-07 14:12:42 +0000
+++ dwt/src/widgets/TabView.cpp	2010-08-07 14:25:29 +0000
@@ -464,15 +464,23 @@
 		if(mouseEvent.isShiftPressed)
 			ti->w->close();
 		else {
-			closeAuthorized = inCloseRect(mouseEvent.pos);
 			dragging = ti->w;
 			::SetCapture(handle());
+			if(hasStyle(TCS_OWNERDRAWFIXED)) {
+				int index = findTab(dragging);
+				if(index == active) {
+					closeAuthorized = inCloseRect(mouseEvent.pos);
+					redraw(index);
+				}
+			}
 		}
 	}
 	return true;
 }
 
 bool TabView::handleLeftMouseUp(const MouseEvent& mouseEvent) {
+	bool closeAuth = closeAuthorized;
+	closeAuthorized = false;
 	::ReleaseCapture();
 
 	if(dragging) {
@@ -492,7 +500,7 @@
 		if(dropPos == dragPos) {
 			// the tab hasn't moved; handle the click
 			if(dropPos == active) {
-				if(closeAuthorized && inCloseRect(mouseEvent.pos)) {
+				if(closeAuth && inCloseRect(mouseEvent.pos)) {
 					TabInfo* ti = getTabInfo(active);
 					if(ti)
 						ti->w->close();
@@ -707,8 +715,11 @@
 		rect.size.y = 16;
 
 		UINT format = DFCS_CAPTIONCLOSE | DFCS_FLAT;
-		if(isHighlighted && highlightClose)
+		if(isHighlighted && highlightClose) {
 			format |= DFCS_HOT;
+			if(closeAuthorized)
+				format |= DFCS_PUSHED;
+		}
 		::RECT rc(rect);
 		::DrawFrameControl(canvas.handle(), &rc, DFC_CAPTION, format);
 

=== modified file 'help/settings_tabs.html'
--- help/settings_tabs.html	2010-08-06 21:02:04 +0000
+++ help/settings_tabs.html	2010-08-07 14:25:29 +0000
@@ -10,9 +10,9 @@
 Tabs appear right below toolbar icons; they give you quick access to currently opened windows.
 <h2>First set of choices</h2>
 <p cshelp="IDH_SETTINGS_TABS_DRAW">
-<b>DC++ draws tabs</b>: Select this option to let DC++ draw tabs, which allows it to add more
-customization. (default)<br/>
-<b>Windows draws tabs</b>: Select this option to use standard Windows tabs - DC++ won't be able to
+<b>Let DC++ draw tabs</b>: Select this option to let DC++ draw tabs, which allows it to add more
+customization (such as a close button, different colors and fonts, etc). (default)<br/>
+<b>Use standard Windows tabs</b>: Select this option to use standard Windows tabs - DC++ won't be able to
 customize them.<br/>
 <i>DC++ needs to be restarted for this setting to take effect.</i>
 </p>

=== modified file 'win32/TabsPage.cpp'
--- win32/TabsPage.cpp	2010-08-06 21:26:01 +0000
+++ win32/TabsPage.cpp	2010-08-07 14:25:29 +0000
@@ -64,9 +64,9 @@
 		GroupBoxPtr group = cur->addChild(GroupBox::Seed());
 		group->setHelpId(IDH_SETTINGS_TABS_DRAW);
 		GridPtr cur2 = group->addChild(Grid::Seed(2, 1));
-		dcppDraw = cur2->addChild(RadioButton::Seed(T_("DC++ draws tabs")));
+		dcppDraw = cur2->addChild(RadioButton::Seed(T_("Let DC++ draw tabs")));
 		dcppDraw->onClicked(std::bind(&TabsPage::createPreview, this));
-		RadioButtonPtr button = cur2->addChild(RadioButton::Seed(T_("Windows draws tabs")));
+		RadioButtonPtr button = cur2->addChild(RadioButton::Seed(T_("Use standard Windows tabs")));
 		button->onClicked(std::bind(&TabsPage::createPreview, this));
 		if(SETTING(TAB_STYLE) & TCS_OWNERDRAWFIXED)
 			dcppDraw->setChecked();