Changeset View
Changeset View
Standalone View
Standalone View
src/mode/katemodemenulist.h
1 | /* SPDX-License-Identifier: LGPL-2.0-or-later | 1 | /* SPDX-License-Identifier: LGPL-2.0-or-later | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | Copyright (C) 2019 Nibaldo González S. <nibgonz@gmail.com> | 3 | Copyright (C) 2019-2020 Nibaldo González S. <nibgonz@gmail.com> | ||
4 | 4 | | |||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public | ||
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either | ||
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. | ||
9 | 9 | | |||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Line(s) | |||||
210 | 210 | | |||
211 | private: | 211 | private: | ||
212 | void init(const SearchBarPosition searchBarPos); | 212 | void init(const SearchBarPosition searchBarPos); | ||
213 | 213 | | |||
214 | /** | 214 | /** | ||
215 | * Define the size of the list widget, in pixels. The @p width is also | 215 | * Define the size of the list widget, in pixels. The @p width is also | ||
216 | * applied to the search bar. This does not recalculate the word wrap in items. | 216 | * applied to the search bar. This does not recalculate the word wrap in items. | ||
217 | */ | 217 | */ | ||
218 | inline void setSizeList(const int height, const int width = 260); | 218 | inline void setSizeList(const int height, const int width = 266); | ||
219 | 219 | | |||
220 | /** | 220 | /** | ||
221 | * Load the data model with the syntax highlighting definitions to show in the list. | 221 | * Load the data model with the syntax highlighting definitions to show in the list. | ||
222 | */ | 222 | */ | ||
223 | void loadHighlightingModel(); | 223 | void loadHighlightingModel(); | ||
224 | 224 | | |||
225 | /** | 225 | /** | ||
226 | * Scroll the list, according to AutoScroll. | 226 | * Scroll the list, according to AutoScroll. | ||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | |||||
293 | * NOTE: Selected and inactive items show an icon with incorrect color, | 293 | * NOTE: Selected and inactive items show an icon with incorrect color, | ||
294 | * however, this isn't a problem, since the list widget is never inactive. | 294 | * however, this isn't a problem, since the list widget is never inactive. | ||
295 | */ | 295 | */ | ||
296 | const QIcon m_checkIcon = QIcon::fromTheme(QStringLiteral("checkbox")); | 296 | const QIcon m_checkIcon = QIcon::fromTheme(QStringLiteral("checkbox")); | ||
297 | QIcon m_emptyIcon; | 297 | QIcon m_emptyIcon; | ||
298 | int m_iconSize = 16; | 298 | int m_iconSize = 16; | ||
299 | 299 | | |||
300 | int m_defaultHeightItemSection; | 300 | int m_defaultHeightItemSection; | ||
301 | static const int m_scrollbarMargin = 2; | | |||
302 | 301 | | |||
303 | QPointer<KTextEditor::DocumentPrivate> m_doc; | 302 | QPointer<KTextEditor::DocumentPrivate> m_doc; | ||
304 | 303 | | |||
305 | private Q_SLOTS: | 304 | private Q_SLOTS: | ||
306 | /** | 305 | /** | ||
307 | * Action when selecting a item in the list. This also applies | 306 | * Action when selecting a item in the list. This also applies | ||
308 | * the syntax highlighting in the document and hides the menu. | 307 | * the syntax highlighting in the document and hides the menu. | ||
309 | * This is equivalent to KateModeMenuList::selectHighlightingSetVisibility(). | 308 | * This is equivalent to KateModeMenuList::selectHighlightingSetVisibility(). | ||
Show All 22 Lines | 330 | public: | |||
332 | ~ListView() | 331 | ~ListView() | ||
333 | { | 332 | { | ||
334 | } | 333 | } | ||
335 | 334 | | |||
336 | /** | 335 | /** | ||
337 | * Define the size of the widget list. | 336 | * Define the size of the widget list. | ||
338 | * @p height and @p width are values in pixels. | 337 | * @p height and @p width are values in pixels. | ||
339 | */ | 338 | */ | ||
340 | void setSizeList(const int height, const int width = 260); | 339 | void setSizeList(const int height, const int width = 266); | ||
341 | 340 | | |||
342 | /** | 341 | /** | ||
343 | * Get the width of the list, in pixels. | 342 | * Get the width of the list, in pixels. | ||
344 | * @see QAbstractScrollArea::sizeHint() | 343 | * @see QAbstractScrollArea::sizeHint() | ||
345 | */ | 344 | */ | ||
346 | inline int getWidth() const; | 345 | inline int getWidth() const; | ||
347 | 346 | | |||
348 | /** | 347 | /** | ||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |