whosh's People
Forkers
meteoritt develop1 wegorich flintrepa evgenyt90 kukubadze dzmuh moldovich wade-3 hitalik refandler artemprodigy oleg-kosarev dinn2012 xklx pav1uxa alexkir85 rumkit alexmarch1 igrik-x macleopard mokeev1995 gidrapitarda lordron al94po keniro leonsadeness semukov vss-dev lairnanwhosh's Issues
TitleBarMouseMove Window.Left Error in multiscreen system
This correct code:
public void TitleBarMouseMove(object _sender, MouseEventArgs _e)
{
if (_e.LeftButton == MouseButtonState.Pressed)
{
_sender.ForWindowFromTemplate(_w =>
{
if (_w.WindowState == WindowState.Maximized)
{
_w.BeginInit();
const double adjustment = 40.0;
Point mouse1 = _e.MouseDevice.GetPosition(_w);
Point mouseScreen = _w.PointToScreen(mouse1);
var width1 = Math.Max(_w.ActualWidth - 2 * adjustment, adjustment);
_w.WindowState = WindowState.Normal;
var width2 = Math.Max(_w.ActualWidth - 2 * adjustment, adjustment);
_w.Left = mouseScreen.X - (mouse1.X - adjustment) * (1 - width2 / width1);
_w.Top = -7;
_w.EndInit();
_w.DragMove();
}
});
}
}
Window Rect
Hi D-Key,
First or all, sorry for contacting you here, as I do not have a Habrahabr account, neither have you specified your email at your github page.
Your implementation is wonderful, yet incomplete. I'm a WPF developer myself, and the reason I still do not use VS2012-like and Office 2013-like window styles in WPF, is because windows like yours (or my own implementation) yield wrong GetWindowRect results. I find this a serious issue.
The rectangle returned is the rectangle of the 'true' window, that is, including the shadow and the transparent part. When you see it, it looks very ugly. Possibly the best way to see it is:
- Sleep the rendering thread (UI thread) for a while. Let's say, for 30 seconds.
- Now, quickly switch to your window, click it here and there until DWM considers it freezed and renders the standard border itself.
Another simple way to 'see' the window rectangle, is using an app like AltDrag.
I have open-sourced my own window style a few minutes ago: https://gist.github.com/4076728
This is an advanced window, that fully emulates standard window behavior (at least on Windows 8) -- even better than VS2012 window itself! My implementation is based on MahApps.Metro window.
Please also keep in mind that my window's XAML template is not generic there -- I do not have a generic template (yet).
Now, if we do cooperate, we may solve even more issues and make a perfect generic window style. If you agree with me, could you please send me an email (visible on my github page), or contact me in any other way that works for you?
I do have most of IM protocols, feel free to use any one that suits best for you. We can still talk here of course.
Thanks!
-LordJZ
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.