← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2891: change the client -> window size conversion in dynamic dialogs

 

------------------------------------------------------------
revno: 2891
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Mon 2012-04-02 00:05:58 +0200
message:
  change the client -> window size conversion in dynamic dialogs
modified:
  dwt/include/dwt/aspects/Dialog.h
  win32/GridDialog.cpp
  win32/HubFrame.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/include/dwt/aspects/Dialog.h'
--- dwt/include/dwt/aspects/Dialog.h	2012-01-13 20:55:20 +0000
+++ dwt/include/dwt/aspects/Dialog.h	2012-04-01 22:05:58 +0000
@@ -65,14 +65,6 @@
 
 protected:
 	static INT_PTR CALLBACK dialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-
-	static unsigned getYBorders() {
-		static unsigned ret = 0;
-		if(!ret) {
-			ret = ::GetSystemMetrics(SM_CYSIZE) + 2 * ::GetSystemMetrics(SM_CYEDGE) + 2 * ::GetSystemMetrics(SM_CXFIXEDFRAME);
-		}
-		return ret;
-	}
 };
 
 /**

=== modified file 'win32/GridDialog.cpp'
--- win32/GridDialog.cpp	2012-01-13 20:55:20 +0000
+++ win32/GridDialog.cpp	2012-04-01 22:05:58 +0000
@@ -50,6 +50,11 @@
 
 	// now resize the dialog itself
 	sz.x = width * dwt::util::dpiFactor(); // don't change the horizontal size
-	sz.y += spacing * 2 + getYBorders();
+	sz.y += spacing * 2;
+
+	RECT rect = { 0, 0, 0, sz.y };
+	::AdjustWindowRectEx(&rect, ::GetWindowLong(handle(), GWL_STYLE), FALSE, ::GetWindowLong(handle(), GWL_EXSTYLE));
+	sz.y = rect.bottom - rect.top;
+
 	resize(dwt::Rectangle(getWindowRect().pos, sz));
 }

=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp	2012-03-18 15:21:56 +0000
+++ win32/HubFrame.cpp	2012-04-01 22:05:58 +0000
@@ -865,10 +865,10 @@
 }
 
 void HubFrame::on(Connecting, Client*) noexcept {
-	tstring hubUrl = Text::toT(Util::addBrackets(client->getHubUrl()));
+	auto hubUrl = client->getHubUrl();
 	callAsync([this, hubUrl] {
-		addStatus(str(TF_("Connecting to %1%...") % hubUrl));
-		setText(hubUrl);
+		addStatus(str(TF_("Connecting to %1%...") % Text::toT(Util::addBrackets(hubUrl))));
+		setText(Text::toT(hubUrl));
 	});
 }
 void HubFrame::on(Connected, Client*) noexcept {