Code Monkey home page Code Monkey logo

whosh's People

Contributors

d-key avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whosh'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:

  1. Sleep the rendering thread (UI thread) for a while. Let's say, for 30 seconds.
  2. 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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.