Changeset View
Changeset View
Standalone View
Standalone View
krusader/KViewer/lister.cpp
Context not available. | |||||
64 | #include "../icon.h" | 64 | #include "../icon.h" | ||
---|---|---|---|---|---|
65 | #include "../kractions.h" | 65 | #include "../kractions.h" | ||
66 | #include "../GUI/krremoteencodingmenu.h" | 66 | #include "../GUI/krremoteencodingmenu.h" | ||
67 | #include "../compat.h" | ||||
67 | 68 | | |||
68 | #define SEARCH_CACHE_CHARS 100000 | 69 | #define SEARCH_CACHE_CHARS 100000 | ||
69 | #define SEARCH_MAX_ROW_LEN 4000 | 70 | #define SEARCH_MAX_ROW_LEN 4000 | ||
Context not available. | |||||
127 | 128 | | |||
128 | // This is quite accurate (although not perfect) way of getting | 129 | // This is quite accurate (although not perfect) way of getting | ||
129 | // a single character width along with its surrounding space. | 130 | // a single character width along with its surrounding space. | ||
130 | const float fontWidth = (fm.width("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW") - fm.width("W")) / 99.0; | 131 | const float fontWidth = (fm.QFONTMETRICS_WIDTH("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW") - fm.QFONTMETRICS_WIDTH("W")) / 99.0; | ||
131 | 132 | | |||
132 | const int sizeY = contentRect.height() / fontHeight; | 133 | const int sizeY = contentRect.height() / fontHeight; | ||
133 | _pageSize = sizeY; | 134 | _pageSize = sizeY; | ||
Context not available. | |||||
2017 | 2018 | | |||
2018 | const QFontMetrics fmFixed(fixedFont); | 2019 | const QFontMetrics fmFixed(fixedFont); | ||
2019 | const int fixedFontHeight = std::max(fmFixed.height(), 1); | 2020 | const int fixedFontHeight = std::max(fmFixed.height(), 1); | ||
2020 | const int fixedFontWidth = std::max(fmFixed.width("W"), 1); | 2021 | const int fixedFontWidth = std::max(fmFixed.QFONTMETRICS_WIDTH("W"), 1); | ||
2021 | 2022 | | |||
2022 | const int effPageSize = drawingRect.height() - normalFontHeight - 1; | 2023 | const int effPageSize = drawingRect.height() - normalFontHeight - 1; | ||
2023 | const int rowsPerPage = std::max(effPageSize / fixedFontHeight, 1); | 2024 | const int rowsPerPage = std::max(effPageSize / fixedFontHeight, 1); | ||
Context not available. |