| 126 | } // namespace |
| 127 | |
| 128 | [[nodiscard]] WindowPosition AdjustToScale( |
| 129 | WindowPosition position, |
| 130 | const QString &name) { |
| 131 | DEBUG_LOG(("%1 Pos: Initializing first %2, %3, %4, %5 " |
| 132 | "(scale %6%, maximized %7)") |
| 133 | .arg(name) |
| 134 | .arg(position.x) |
| 135 | .arg(position.y) |
| 136 | .arg(position.w) |
| 137 | .arg(position.h) |
| 138 | .arg(position.scale) |
| 139 | .arg(position.maximized)); |
| 140 | |
| 141 | if (!position.scale) { |
| 142 | return position; |
| 143 | } |
| 144 | const auto scaleFactor = cScale() / float64(position.scale); |
| 145 | if (scaleFactor != 1.) { |
| 146 | // Change scale while keeping the position center in place. |
| 147 | position.x += position.w / 2; |
| 148 | position.y += position.h / 2; |
| 149 | position.w *= scaleFactor; |
| 150 | position.h *= scaleFactor; |
| 151 | position.x -= position.w / 2; |
| 152 | position.y -= position.h / 2; |
| 153 | } |
| 154 | return position; |
| 155 | } |
| 156 | |
| 157 | Settings::Settings() |
| 158 | : _sendSubmitWay(Ui::InputSubmitSettings::Enter) |
no test coverage detected