changed checkbox name and simplified code for swapDisplayScreens

preferencesAboutTextFull
Clément Fauconnier 7 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"> <item row="2" column="3">
<widget class="QCheckBox" name="swapDisplayScreensCheckBox"> <widget class="QCheckBox" name="swapDisplayScreensCheckBox">
<property name="text"> <property name="text">
<string>Swap first and second displays</string> <string>Swap first and second view displays</string>
</property> </property>
</widget> </widget>
</item> </item>

@ -109,46 +109,7 @@ void UBDisplayManager::initScreenIndexes()
void UBDisplayManager::swapDisplayScreens(bool swap) void UBDisplayManager::swapDisplayScreens(bool swap)
{ {
int screenCount = numScreens(); initScreenIndexes();
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);
}
}
if (swap) if (swap)
{ {

Loading…
Cancel
Save