fixed 1px gaps/removed unnecesary com call

This commit is contained in:
Hane 2024-12-18 00:44:33 +01:00
commit 801adbb17e
2 changed files with 9 additions and 18 deletions

View file

@ -225,7 +225,7 @@ QRect MainWindow::setSizePosition(QScreen* screen, int width, int height) {
QRect availableRes = screen->availableGeometry();
int arx1, arx2, ary1, ary2;
availableRes.getCoords(&arx1, &ary1, &arx2, &ary2);
log_debugcpp("Available res: " + std::to_string(arx1) + " " + std::to_string(arx2)+" " + std::to_string(ary1) + " " + std::to_string(ary2));
log_debugcpp("Available res: " + std::to_string(arx1) + " " + std::to_string(arx2)+" " + std::to_string(ary1) + " " + std::to_string(ary2);)
if(height > (ary2 - ary1)) height = (ary2 - ary1);
log_debugcpp("Height res: " + std::to_string(height));
@ -235,22 +235,22 @@ QRect MainWindow::setSizePosition(QScreen* screen, int width, int height) {
int rightDistance = std::abs(srx2 - tix1);
int upDistance = std::abs(sry1 - tiy1);
int downDistance = std::abs(sry2 - tiy1);
pos = (upDistance < downDistance) ? SpawnPos::UP : SpawnPos::DOWN;
pos = (leftDistance < rightDistance) ? pos | SpawnPos::LEFT : pos | SpawnPos::RIGHT;
switch (pos) {
case SpawnPos::UP | SpawnPos::RIGHT:
this->addToolBar(Qt::BottomToolBarArea, mainMenuBar);
return QRect((arx2 - width), ary1, width, height);
return QRect((arx2 - width + 1), ary1, width, height);
break;
case SpawnPos::DOWN | SpawnPos::LEFT:
this->addToolBar(Qt::TopToolBarArea, mainMenuBar);
return QRect(arx1, (ary2-height), width, height);
return QRect(arx1, (ary2 - height + 1), width, height);
break;
case SpawnPos::DOWN | SpawnPos::RIGHT:
this->addToolBar(Qt::TopToolBarArea, mainMenuBar);
return QRect((arx2 - width), (ary2-height), width, height);
return QRect((arx2 - width + 1), (ary2 - height + 1), width, height);
break;
default:
this->addToolBar(Qt::BottomToolBarArea, mainMenuBar);
@ -414,6 +414,7 @@ SessionWidget::SessionWidget(uint64_t idx, SessionHandler* sh, QWidget *parent)
mainSlider->setValue((int)((sh->getVolumeInfo()->mainVolume + roundingFactor) * 100));
mainSlider->setPeakValue(sh->getPeakVolume());
mainSlider->update();
//log_wdebugcpp(L"Session: " + sh->getName() + L" peak value: " + std::to_wstring(sh->getPeakVolume()));
muteButton->setCheckState((sh->getVolumeInfo()->muted == false ? Qt::Unchecked : Qt::Checked));
muteButton->setText(sh->getVolumeInfo()->muted ? STRING_UNMUTE : STRING_MUTE);
//memcpy(osh->callbackInfo[idx]->caller, osh->getGuid(), sizeof(NGuid));