aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Slit.cc27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/Slit.cc b/src/Slit.cc
index 396cad8..566b76d 100644
--- a/src/Slit.cc
+++ b/src/Slit.cc
@@ -910,11 +910,17 @@ void Slit::clientUp(SlitClient* client) {
910 if (!client || m_client_list.size() < 2) 910 if (!client || m_client_list.size() < 2)
911 return; 911 return;
912 912
913 if (client == m_client_list.front()) {
914 cycleClientsUp();
915 return;
916 }
917
913 SlitClients::iterator it = m_client_list.begin(); 918 SlitClients::iterator it = m_client_list.begin();
914
915 for(it++; it != m_client_list.end(); it++) { 919 for(it++; it != m_client_list.end(); it++) {
916 if ((*it) == client) { 920 if ((*it) == client) {
917 swap(*it, *(it--)); 921 SlitClients::iterator prev = it;
922 prev--;
923 iter_swap(it, prev);
918 reconfigure(); 924 reconfigure();
919 break; 925 break;
920 } 926 }
@@ -924,11 +930,18 @@ void Slit::clientUp(SlitClient* client) {
924void Slit::clientDown(SlitClient* client) { 930void Slit::clientDown(SlitClient* client) {
925 if (!client || m_client_list.size() < 2) 931 if (!client || m_client_list.size() < 2)
926 return; 932 return;
927 933
934 if (client == m_client_list.back()) {
935 cycleClientsDown();
936 return;
937 }
938
928 SlitClients::reverse_iterator it = m_client_list.rbegin(); 939 SlitClients::reverse_iterator it = m_client_list.rbegin();
929 for(it++; it != m_client_list.rend(); it++) { 940 for(it++; it != m_client_list.rend(); it++) {
930 if ((*it) == client) { 941 if ((*it) == client) {
931 swap(*it, *(it--)); 942 SlitClients::reverse_iterator next = it;
943 next--;
944 iter_swap(it, next);
932 reconfigure(); 945 reconfigure();
933 break; 946 break;
934 } 947 }
@@ -1161,7 +1174,7 @@ void Slit::updateClientmenu() {
1161 "Save SlitList", "Saves the current order in the slit"), 1174 "Save SlitList", "Saves the current order in the slit"),
1162 savecmd); 1175 savecmd);
1163 1176
1164 m_clientlist_menu.update(); 1177 m_clientlist_menu.updateMenu();
1165} 1178}
1166 1179
1167void Slit::saveClientList() { 1180void Slit::saveClientList() {
@@ -1258,7 +1271,7 @@ void Slit::setupMenu() {
1258 *this, 1271 *this,
1259 save_and_reconfigure)); 1272 save_and_reconfigure));
1260 m_slitmenu.insert(_FBTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu); 1273 m_slitmenu.insert(_FBTEXT(Slit, ClientsMenu, "Clients", "Slit client menu"), &m_clientlist_menu);
1261 m_slitmenu.update(); 1274 m_slitmenu.updateMenu();
1262 1275
1263 // setup sub menu 1276 // setup sub menu
1264 m_placement_menu.setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement")); 1277 m_placement_menu.setLabel(_FBTEXT(Slit, Placement, "Slit Placement", "Slit Placement"));
@@ -1300,7 +1313,7 @@ void Slit::setupMenu() {
1300 } 1313 }
1301 1314
1302 // finaly update sub menu 1315 // finaly update sub menu
1303 m_placement_menu.update(); 1316 m_placement_menu.updateMenu();
1304} 1317}
1305 1318
1306void Slit::moveToLayer(int layernum) { 1319void Slit::moveToLayer(int layernum) {