Ticket #11819: filezilla_subdir_selected.patch

File filezilla_subdir_selected.patch, 4.5 KB (added by iqiqiq, 6 years ago)
  • src/interface/LocalListView.cpp

     
    12881288        for (unsigned int i = 0; i < m_indexMapping.size(); ++i) {
    12891289            const CLocalFileData &data = m_fileData[m_indexMapping[i]];
    12901290            if (data.name == focused) {
    1291                 SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     1291                SetItemState(i, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    12921292                if (ensureVisible) {
    12931293                    EnsureVisible(i);
    12941294                }
     
    13001300            if (focusedItem >= GetItemCount()) {
    13011301                --focusedItem;
    13021302            }
    1303             SetItemState(focusedItem, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     1303            SetItemState(focusedItem, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    13041304        }
    13051305        return;
    13061306    }
     
    13121312        while (++i < (int)m_indexMapping.size()) {
    13131313            const CLocalFileData &data = m_fileData[m_indexMapping[i]];
    13141314            if (data.name == focused) {
    1315                 SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     1315                SetItemState(i, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    13161316                if (ensureVisible) {
    13171317                    EnsureVisible(i);
    13181318                }
     
    13461346    }
    13471347    if (!focused.empty()) {
    13481348        if (firstSelected != -1) {
    1349             SetItemState(firstSelected, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     1349            SetItemState(firstSelected, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    13501350        }
    13511351        else {
    13521352            if (GetItemCount() != 0) {
     
    13561356                else if (focusedItem >= GetItemCount()) {
    13571357                    focusedItem = GetItemCount() - 1;
    13581358                }
    1359                 SetItemState(focusedItem, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     1359                SetItemState(focusedItem, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    13601360            }
    13611361        }
    13621362    }
     
    19591959
    19601960        std::wstring error;
    19611961        if (!m_state.SetLocalDir(_T(".."), &error)) {
     1962
    19621963            if (!error.empty()) {
    19631964                wxMessageBoxEx(error, _("Failed to change directory"), wxICON_INFORMATION);
    19641965            }
  • src/interface/RemoteListView.cpp

     
    20612061
    20622062    if (focused == L"..") {
    20632063        focused.clear();
    2064         SetItemState(0, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     2064        SetItemState(0, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    20652065    }
    20662066
    20672067    if (selectedNames.empty()) {
     
    20762076            }
    20772077
    20782078            if ((*m_pDirectoryListing)[index].name == focused) {
    2079                 SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     2079                SetItemState(i, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    20802080                if (ensureVisible) {
    20812081                    EnsureVisible(i);
    20822082                }
     
    20882088            if (focusedItem >= GetItemCount()) {
    20892089                --focusedItem;
    20902090            }
    2091             SetItemState(focusedItem, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     2091            SetItemState(focusedItem, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    20922092        }
    20932093
    20942094        return;
     
    20972097        auto nameIt = selectedNames.cbegin();
    20982098        if (*nameIt == L"..") {
    20992099            ++nameIt;
    2100             SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
     2100            SetItemState(0, wxLIST_STATE_SELECTED|wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED|wxLIST_STATE_SELECTED);
    21012101        }
    21022102
    21032103        int firstSelected = -1;
     
    21142114                }
    21152115                CDirentry const& entry = (*m_pDirectoryListing)[index];
    21162116                if (entry.name == focused) {
    2117                     SetItemState(i, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     2117                    SetItemState(i, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    21182118                    if (ensureVisible) {
    21192119                        EnsureVisible(i);
    21202120                    }
     
    21482148        }
    21492149        if (!focused.empty()) {
    21502150            if (firstSelected != -1) {
    2151                 SetItemState(firstSelected, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     2151                SetItemState(firstSelected, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    21522152            }
    21532153            else {
    21542154                if (GetItemCount() != 0) {
     
    21582158                    else if (focusedItem >= GetItemCount()) {
    21592159                        focusedItem = GetItemCount() - 1;
    21602160                    }
    2161                     SetItemState(focusedItem, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
     2161                    SetItemState(focusedItem, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
    21622162                }
    21632163            }
    21642164        }