changed checkbox name and simplified code for swapDisplayScreens

preferencesAboutTextFull
Clément Fauconnier 6 years ago
parent 823115bd1d
commit 2b1af9d27c
  1. 2
      resources/forms/preferences.ui
  2. 41
      src/core/UBDisplayManager.cpp

@ -134,7 +134,7 @@
<item row="2" column="3">
<widget class="QCheckBox" name="swapDisplayScreensCheckBox">
<property name="text">
<string>Swap first and second displays</string>
<string>Swap first and second view displays</string>
</property>
</widget>
</item>

@ -109,46 +109,7 @@ void UBDisplayManager::initScreenIndexes()
void UBDisplayManager::swapDisplayScreens(bool swap)
{
int screenCount = numScreens();
mScreenIndexesRoles.clear();
if (screenCount > 0)
{
mControlScreenIndex = mDesktop->primaryScreen();
if (screenCount > 1 && UBSettings::settings()->swapControlAndDisplayScreens->get().toBool())
{
mControlScreenIndex = mControlScreenIndex^1;
}
mScreenIndexesRoles << Control;
}
else
{
mControlScreenIndex = -1;
}
if (screenCount > 1 && mUseMultiScreen)
{
mDisplayScreenIndex = mControlScreenIndex != 0 ? 0 : 1;
mScreenIndexesRoles << Display;
}
else
{
mDisplayScreenIndex = -1;
}
mPreviousScreenIndexes.clear();
if (screenCount > 2)
{
for(int i = 2; i < screenCount; i++)
{
if(mControlScreenIndex == i)
mPreviousScreenIndexes.append(1);
else
mPreviousScreenIndexes.append(i);
}
}
initScreenIndexes();
if (swap)
{

Loading…
Cancel
Save