void XYVirtualKeyboard::mouseMoveEvent(QMouseEvent *event) { if (resizeType != No) { resizeRequest(event); } }
void TerminalModel::setSize(const QSize& size) { if ((size.width() <= 1) || (size.height() <= 1)) return; emit resizeRequest(size); }
void Session::setSize(const QSize& size) { if ((size.width() <= 1) || (size.height() <= 1)) return; emit resizeRequest(size); }
void Robot25DWindow::mouseDoubleClickEvent(QMouseEvent *event) { QScrollBar * vert = verticalScrollBar(); QScrollBar * horiz = horizontalScrollBar(); bool scrollable = vert->maximum() + horiz->maximum() > 0; if (scrollable) { emit resizeRequest(sizeHint()); event->accept(); } else { event->ignore(); } }
void ResizerWindow::MessageReceived(BMessage* message) { switch (message->what) { // public actions case kActivateMsg: Activate(); break; case kUpdateMsg: { // update aspect ratio, width and height int32 width, height; if (message->FindInt32("width", &width) == B_OK && message->FindInt32("height", &height) == B_OK) { fOriginalWidth = width; fOriginalHeight = height; BString widthText, heightText; widthText << width; heightText << height; // here the statement order is important: // in case keep aspect ratio is enabled, // the width should determine the height fHeight->SetText(heightText.String()); fWidth->SetText(widthText.String()); } break; } // private actions case kResolutionMsg: { fAspectRatio->SetValue(B_CONTROL_OFF); BString width, height; width << message->FindInt32("w"); height << message->FindInt32("h"); fWidth->SetText(width.String()); fHeight->SetText(height.String()); break; } case kWidthModifiedMsg: if (fAspectRatio->Value() == B_CONTROL_ON) { int w = atoi(fWidth->Text()); int h = (int)((int64)w * (int64) fOriginalHeight / (int64) fOriginalWidth); BString height; height << h; BMessage* msg = new BMessage(*fHeight->ModificationMessage()); fHeight->SetModificationMessage(NULL); fHeight->SetText(height.String()); fHeight->SetModificationMessage(msg); } break; case kHeightModifiedMsg: if (fAspectRatio->Value() == B_CONTROL_ON) { int h = atoi(fHeight->Text()); int w = (int)((int64)h * (int64) fOriginalWidth / (int64) fOriginalHeight); BString width; width << w; BMessage* msg = new BMessage(*fWidth->ModificationMessage()); fWidth->SetModificationMessage(NULL); fWidth->SetText(width.String()); fWidth->SetModificationMessage(msg); } break; case kApplyMsg: { BMessage resizeRequest(MSG_RESIZE); resizeRequest.AddInt32("h", atoi(fHeight->Text())); resizeRequest.AddInt32("w", atoi(fWidth->Text())); fTarget.SendMessage(&resizeRequest); PostMessage(B_QUIT_REQUESTED); break; } default: BWindow::MessageReceived(message); } }
void DockWindowPlace::processResize(const QSize &sz) { resize(sz); emit resizeRequest(sz); }