Improve Chatterino extension positioning (#1825)

This adds support for left-side chat
This commit is contained in:
Matthew Marlow
2020-08-01 06:42:56 -07:00
committed by GitHub
parent 214afc8fc2
commit e5f3bc9f3f
3 changed files with 21 additions and 5 deletions
+17 -4
View File
@@ -91,6 +91,8 @@ AttachedWindow *AttachedWindow::get(void *target, const GetArgs &args)
window->fullscreen_ = args.fullscreen;
window->x_ = args.x;
if (args.height != -1)
{
if (args.height == 0)
@@ -269,10 +271,21 @@ void AttachedWindow::updateWindowRect(void *_attachedPtr)
// offset
int o = this->fullscreen_ ? 0 : 8;
::MoveWindow(hwnd, int(rect.right - this->width_ * scale - o),
int(rect.bottom - this->height_ * scale - o),
int(this->width_ * scale), int(this->height_ * scale),
true);
if (this->x_ != -1)
{
::MoveWindow(hwnd, int(rect.left + this->x_ * scale + o),
int(rect.bottom - this->height_ * scale - o),
int(this->width_ * scale), int(this->height_ * scale),
true);
}
//support for old extension version 1.2
else
{
::MoveWindow(hwnd, int(rect.right - this->width_ * scale - o),
int(rect.bottom - this->height_ * scale - o),
int(this->width_ * scale), int(this->height_ * scale),
true);
}
}
// if (this->fullscreen_)