digiKam
|
Classes | |
class | Private |
Public Types | |
enum | StateSavingDepth { INSTANCE , DIRECT_CHILDREN , RECURSIVE } |
enum | TextStyle { ActiveIconText = 0 , AllIconsText = 2 } |
Signals | |
void | signalChangedTab (QWidget *w) |
void | signalViewChanged () |
Public Member Functions | |
void | activeNextTab () |
void | activePreviousTab () |
void | appendButton (const QPixmap &pic, int id=-1, QMenu *const popup=nullptr, const QString ¬_used_yet=QString()) |
void | appendTab (const QPixmap &pic, int id=-1, const QString &text=QString()) |
void | appendTab (QWidget *const w, const QIcon &pic, const QString &title) |
void | backup () |
void | backup (const QList< QWidget * > &thirdWidgetsToBackup, QList< int > *const sizes) |
DMultiTabBarButton * | button (int id) const |
void | deleteTab (QWidget *const w) |
void | expand () |
QWidget * | getActiveTab () const |
StateSavingDepth | getStateSavingDepth () const |
bool | isExpanded () const |
bool | isTabRaised (int id) const |
void | loadState () |
Qt::Edge | position () const |
void | removeButton (int id) |
void | removeTab (int id) |
void | restore () |
void | restore (const QList< QWidget * > &thirdWidgetsToRestore, const QList< int > &sizes) |
void | saveState () |
void | setActiveTab (QWidget *const w) |
virtual void | setConfigGroup (const KConfigGroup &group) |
virtual void | setEntryPrefix (const QString &prefix) |
void | setPosition (Qt::Edge pos) |
void | setStateSavingDepth (const StateSavingDepth depth) |
void | setStyle (TextStyle style) |
void | setTab (int id, bool state) |
void | shrink () |
Sidebar (QWidget *const parent, SidebarSplitter *const sp, Qt::Edge side=Qt::LeftEdge, bool minimizedDefault=false) | |
SidebarSplitter * | splitter () const |
DMultiTabBarTab * | tab (int id) const |
TextStyle | tabStyle () const |
~Sidebar () override | |
Protected Member Functions | |
void | doLoadState () override |
void | doSaveState () override |
QString | entryName (const QString &base) const |
virtual void | fontChange (const QFont &) |
KConfigGroup | getConfigGroup () const |
void | updateSeparator () |
Friends | |
class | SidebarSplitter |
This class handles a sidebar view
Since this class derives from StateSavingObject, you can call StateSavingObject::loadState() and StateSavingObject::saveState() for loading/saving of settings. However, if you use multiple sidebar instances in your program, you have to remember to either call QObject::setObjectName(), StateSavingObject::setEntryPrefix() or StateSavingObject::setConfigGroup() first.
|
inherited |
This enum defines the "depth" of the StateSavingObject::loadState() and StateSavingObject::saveState() methods.
Enumerator | |
---|---|
INSTANCE | Only the instance the saving / restoring was invoked on is saved / restored. |
DIRECT_CHILDREN | The instance itself and all direct children of this instance implementing StateSavingObject are saved / restored. |
RECURSIVE | The instance and all children in the complete hierarchy are saved / restored. |
|
inherited |
The list of available styles for DMultiTabBar
Enumerator | |
---|---|
ActiveIconText | Always shows icon, only show the text of active tabs. |
AllIconsText | Always shows the text and icons. |
|
explicit |
Creates a new sidebar
parent | sidebar's parent |
sp | sets the splitter, which should handle the width. The splitter normally is part of the main view. Internally, the width of the widget stack can be changed by a QSplitter. |
side | where the sidebar should be displayed. At the left or right border. Use Qt::LeftEdge or Qt::RightEdge. |
minimizedDefault | hide the sidebar when the program is started the first time. |
References Digikam::DMultiTabBar::ActiveIconText, Digikam::Sidebar::Private::dragSwitchTimer, Digikam::Sidebar::Private::minimizedDefault, Digikam::DMultiTabBar::setStyle(), Digikam::Sidebar::Private::splitter, and Digikam::Sidebar::Private::stack.
|
override |
void Digikam::Sidebar::activeNextTab | ( | ) |
Activates a next tab from current one. If current one is last, first one is activated.
References setActiveTab(), Digikam::Sidebar::Private::stack, Digikam::DMultiTabBar::tab(), and Digikam::Sidebar::Private::tabs.
Referenced by Digikam::ItemIconView::nextLeftSideBarTab(), and Digikam::ItemIconView::nextRightSideBarTab().
void Digikam::Sidebar::activePreviousTab | ( | ) |
Activates a previous tab from current one. If current one is first, last one is activated.
References setActiveTab(), Digikam::Sidebar::Private::stack, Digikam::DMultiTabBar::tab(), and Digikam::Sidebar::Private::tabs.
Referenced by Digikam::ItemIconView::previousLeftSideBarTab(), and Digikam::ItemIconView::previousRightSideBarTab().
|
inherited |
append a new button to the button area. The button can later on be accessed with button(ID) eg for connecting signals to it
pic | a pixmap for the button |
id | an arbitrary ID value. It will be emitted in the clicked signal for identifying the button if more than one button is connected to a signals. |
popup | A popup menu which should be displayed if the button is clicked |
not_used_yet | will be used for a popup text in the future |
References Digikam::DMultiTabBar::Private::btnTabSep, Digikam::DMultiTabBar::Private::buttons, Digikam::DMultiTabBar::DMultiTabBarButton, and Digikam::DMultiTabBar::Private::layout.
|
inherited |
append a new tab to the tab area. It can be accessed later on with tabb(id);
pic | a bitmap for the tab |
id | an arbitrary ID which can be used later on to identify the tab |
text | if a mode with text is used it will be the tab text, otherwise a mouse over hint |
References Digikam::DMultiTabBarFrame::appendTab(), and Digikam::DMultiTabBar::Private::internal.
Referenced by appendTab().
void Digikam::Sidebar::appendTab | ( | QWidget *const | w, |
const QIcon & | pic, | ||
const QString & | title | ||
) |
Appends a new tab to the sidebar
w | widget which is activated by this tab |
pic | icon which is shown in this tab |
title | text which is shown it this tab |
References Digikam::Sidebar::Private::appendedTabsStateCache, Digikam::DMultiTabBar::appendTab(), Digikam::SidebarSplitter::size(), Digikam::Sidebar::Private::splitter, Digikam::Sidebar::Private::stack, Digikam::DMultiTabBar::tab(), and Digikam::Sidebar::Private::tabs.
Referenced by Digikam::ImportItemPropertiesSideBarImport::ImportItemPropertiesSideBarImport(), Digikam::ItemIconView::ItemIconView(), Digikam::ItemPropertiesSideBar::ItemPropertiesSideBar(), Digikam::ItemPropertiesSideBarDB::ItemPropertiesSideBarDB(), and Digikam::ItemIconView::setToolsIconView().
void Digikam::Sidebar::backup | ( | ) |
Hide sidebar and backup minimized state.
References Digikam::Sidebar::Private::isMinimized, Digikam::Sidebar::Private::minimized, and shrink().
Referenced by backup(), and Digikam::ItemIconView::hideSideBars().
void Digikam::Sidebar::backup | ( | const QList< QWidget * > & | thirdWidgetsToBackup, |
QList< int > *const | sizes | ||
) |
Hide sidebar and backup minimized state. If there are other widgets in this splitter, stores their sizes in the provided list.
References backup(), Digikam::SidebarSplitter::size(), and Digikam::Sidebar::Private::splitter.
|
inherited |
get a pointer to a button within the button area identified by its ID
References Digikam::DMultiTabBar::Private::buttons, and Digikam::DMultiTabBarButton::id().
void Digikam::Sidebar::deleteTab | ( | QWidget *const | w | ) |
Deletes a tab from the tabbar
References Digikam::Sidebar::Private::activeTab, Digikam::SidebarState::activeWidget, Digikam::Sidebar::Private::appendedTabsStateCache, Digikam::Sidebar::Private::minimized, Digikam::DMultiTabBar::removeTab(), Digikam::Sidebar::Private::restoreSize, Digikam::SidebarSplitter::setSize(), Digikam::DMultiTabBar::setTab(), signalChangedTab(), Digikam::SidebarState::size, Digikam::Sidebar::Private::splitter, Digikam::Sidebar::Private::stack, Digikam::DMultiTabBar::tab(), and Digikam::Sidebar::Private::tabs.
|
overrideprotectedvirtual |
Load the last view state from disk - called by StateSavingObject::loadState()
Implements Digikam::StateSavingObject.
References Digikam::Sidebar::Private::activeTab, Digikam::StateSavingObject::entryName(), Digikam::StateSavingObject::getConfigGroup(), Digikam::Sidebar::Private::minimizedDefault, Digikam::Sidebar::Private::optionActiveTabEntry, Digikam::Sidebar::Private::optionMinimizedEntry, Digikam::Sidebar::Private::optionRestoreSizeEntry, Digikam::Sidebar::Private::restoreSize, Digikam::DMultiTabBar::setTab(), shrink(), signalChangedTab(), Digikam::Sidebar::Private::stack, Digikam::DMultiTabBar::tab(), and Digikam::Sidebar::Private::tabs.
Referenced by Digikam::ImportItemPropertiesSideBarImport::doLoadState(), and Digikam::ItemPropertiesSideBar::doLoadState().
|
overrideprotectedvirtual |
Save the view state to disk - called by StateSavingObject::saveState()
Implements Digikam::StateSavingObject.
References Digikam::Sidebar::Private::activeTab, Digikam::StateSavingObject::entryName(), Digikam::StateSavingObject::getConfigGroup(), Digikam::Sidebar::Private::minimized, Digikam::Sidebar::Private::optionActiveTabEntry, Digikam::Sidebar::Private::optionMinimizedEntry, Digikam::Sidebar::Private::optionRestoreSizeEntry, and Digikam::Sidebar::Private::restoreSize.
Referenced by Digikam::ImportItemPropertiesSideBarImport::doSaveState(), and Digikam::ItemPropertiesSideBar::doSaveState().
|
protectedinherited |
Always use this method to create config group entry names. This allows to manipulate the entry keys externally by eg. setting a prefix.
base | original name planned for the config group entry |
Referenced by Digikam::FilterSideBarWidget::doLoadState(), Digikam::AbstractAlbumTreeView::doLoadState(), Digikam::AbstractCheckableAlbumTreeView::doLoadState(), Digikam::LabelsTreeView::doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagCheckView::doLoadState(), doLoadState(), Digikam::SearchTextBar::doLoadState(), ShowFoto::ShowfotoFolderViewSideBar::doLoadState(), ShowFoto::ShowfotoStackViewSideBar::doLoadState(), Digikam::FaceScanWidget::doLoadState(), Digikam::FuzzySearchView::doLoadState(), Digikam::GPSSearchView::doLoadState(), Digikam::FilterSideBarWidget::doSaveState(), Digikam::AbstractAlbumTreeView::doSaveState(), Digikam::AbstractCheckableAlbumTreeView::doSaveState(), Digikam::LabelsTreeView::doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagCheckView::doSaveState(), doSaveState(), Digikam::SearchTextBar::doSaveState(), ShowFoto::ShowfotoFolderViewSideBar::doSaveState(), ShowFoto::ShowfotoStackViewSideBar::doSaveState(), Digikam::FaceScanWidget::doSaveState(), Digikam::FuzzySearchView::doSaveState(), and Digikam::GPSSearchView::doSaveState().
void Digikam::Sidebar::expand | ( | ) |
Redisplays the whole sidebar
References Digikam::Sidebar::Private::minimized, and Digikam::Sidebar::Private::stack.
Referenced by restore(), setActiveTab(), Digikam::ItemIconView::toggleLeftSidebar(), and Digikam::ItemIconView::toggleRightSidebar().
|
protectedvirtualinherited |
QWidget * Digikam::Sidebar::getActiveTab | ( | ) | const |
Returns the currently activated tab, or 0 if no tab is active
References Digikam::Sidebar::Private::splitter, and Digikam::Sidebar::Private::stack.
Referenced by Digikam::ImportItemPropertiesSideBarImport::itemChanged(), Digikam::ItemPropertiesSideBar::itemChanged(), Digikam::ItemIconView::slotAlbumSelected(), and Digikam::ItemIconView::slotSortAlbums().
|
protectedinherited |
Returns the config group that must be used for state saving and loading.
Referenced by Digikam::AlbumFolderViewSideBarWidget::AlbumFolderViewSideBarWidget(), Digikam::DateFolderViewSideBarWidget::DateFolderViewSideBarWidget(), Digikam::FilterSideBarWidget::doLoadState(), Digikam::TagViewSideBarWidget::doLoadState(), Digikam::TimelineSideBarWidget::doLoadState(), Digikam::MapWidgetView::doLoadState(), Digikam::TableView::doLoadState(), Digikam::AbstractAlbumTreeView::doLoadState(), Digikam::AbstractCheckableAlbumTreeView::doLoadState(), Digikam::LabelsTreeView::doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagsManager::doLoadState(), Digikam::TagCheckView::doLoadState(), doLoadState(), Digikam::SearchTextBar::doLoadState(), ShowFoto::ShowfotoFolderViewSideBar::doLoadState(), ShowFoto::ShowfotoStackViewSideBar::doLoadState(), Digikam::FaceScanWidget::doLoadState(), Digikam::FuzzySearchView::doLoadState(), Digikam::GPSSearchView::doLoadState(), Digikam::FilterSideBarWidget::doSaveState(), Digikam::TagViewSideBarWidget::doSaveState(), Digikam::TimelineSideBarWidget::doSaveState(), Digikam::MapWidgetView::doSaveState(), Digikam::TableView::doSaveState(), Digikam::AbstractAlbumTreeView::doSaveState(), Digikam::AbstractCheckableAlbumTreeView::doSaveState(), Digikam::LabelsTreeView::doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagsManager::doSaveState(), Digikam::TagCheckView::doSaveState(), doSaveState(), Digikam::SearchTextBar::doSaveState(), ShowFoto::ShowfotoFolderViewSideBar::doSaveState(), ShowFoto::ShowfotoStackViewSideBar::doSaveState(), Digikam::FaceScanWidget::doSaveState(), Digikam::FuzzySearchView::doSaveState(), Digikam::GPSSearchView::doSaveState(), Digikam::FuzzySearchSideBarWidget::FuzzySearchSideBarWidget(), Digikam::GPSSearchSideBarWidget::GPSSearchSideBarWidget(), Digikam::LabelsSideBarWidget::LabelsSideBarWidget(), Digikam::PeopleSideBarWidget::PeopleSideBarWidget(), Digikam::SearchSideBarWidget::SearchSideBarWidget(), Digikam::TagsManager::setupUi(), Digikam::TagViewSideBarWidget::TagViewSideBarWidget(), and Digikam::TimelineSideBarWidget::TimelineSideBarWidget().
|
inherited |
Returns the depth used for state saving or loading. Default is StateSavingDepth::INSTANCE.
bool Digikam::Sidebar::isExpanded | ( | ) | const |
Return the visible status of current sidebar tab.
References Digikam::Sidebar::Private::minimized.
Referenced by Digikam::ItemIconView::toggleLeftSidebar(), and Digikam::ItemIconView::toggleRightSidebar().
|
inherited |
return the state of a tab, identified by its ID
References Digikam::DMultiTabBar::tab().
|
inherited |
Invokes loading the class' state.
References Digikam::StateSavingObject::doLoadState().
Referenced by Digikam::FuzzySearchView::doLoadState(), Digikam::SearchTextBar::SearchTextBar(), ShowFoto::Showfoto::Showfoto(), and Digikam::TagsManager::TagsManager().
|
inherited |
|
inherited |
remove a button with the given ID
References Digikam::DMultiTabBar::Private::btnTabSep, and Digikam::DMultiTabBar::Private::buttons.
|
inherited |
remove a tab with a given ID
References Digikam::DMultiTabBar::Private::internal, and Digikam::DMultiTabBarFrame::removeTab().
Referenced by deleteTab().
void Digikam::Sidebar::restore | ( | ) |
Show sidebar and restore minimized state.
References expand(), and Digikam::Sidebar::Private::isMinimized.
Referenced by restore(), and Digikam::ItemIconView::showSideBars().
void Digikam::Sidebar::restore | ( | const QList< QWidget * > & | thirdWidgetsToRestore, |
const QList< int > & | sizes | ||
) |
Show sidebar and restore minimized state. Restores other widgets' sizes in splitter.
References restore(), Digikam::SidebarSplitter::setSize(), and Digikam::Sidebar::Private::splitter.
|
inherited |
Invokes saving the class' state.
References Digikam::StateSavingObject::doSaveState().
Referenced by Digikam::ImageWindow::closeEvent(), Digikam::FuzzySearchView::doSaveState(), Digikam::DateFolderView::~DateFolderView(), Digikam::SearchTextBar::~SearchTextBar(), ~Sidebar(), and Digikam::TagsManager::~TagsManager().
void Digikam::Sidebar::setActiveTab | ( | QWidget *const | w | ) |
Activates a tab
References expand(), Digikam::Sidebar::Private::minimized, signalChangedTab(), Digikam::Sidebar::Private::stack, and Digikam::DMultiTabBar::tab().
Referenced by activeNextTab(), activePreviousTab(), Digikam::ItemIconView::slotAssignTag(), Digikam::ItemIconView::slotLeftSideBarActivate(), Digikam::ItemIconView::slotLeftSideBarActivateAlbums(), Digikam::ItemIconView::slotLeftSideBarActivateTags(), Digikam::ItemPropertiesSideBarDB::slotPopupTagsView(), Digikam::ItemIconView::slotRightSideBarActivateAssignedTags(), Digikam::ItemIconView::slotRightSideBarActivateComments(), and Digikam::ItemIconView::slotRightSideBarActivateTitles().
|
virtualinherited |
Sets a dedicated config group that will be used to store and reload the state from. If this method is not called, a group based on the object name is used.
You can re-implement this method to pass the group set here to child objects. Don't forget to call this method in your implementation.
group | config group to use for state saving and restoring |
Reimplemented in Digikam::GPSSearchView, Digikam::FuzzySearchView, Digikam::FilterSideBarWidget, and Digikam::DateFolderView.
Referenced by Digikam::ImageWindow::closeEvent(), Digikam::DateFolderView::setConfigGroup(), Digikam::FilterSideBarWidget::setConfigGroup(), Digikam::FuzzySearchView::setConfigGroup(), and Digikam::GPSSearchView::setConfigGroup().
|
virtualinherited |
Define a prefix that will be used for every entry in the config group. The default prefix is empty.
You can re-implement this method to pass the prefix set here to child objects. Don't forget to call this method in your implementation.
prefix | the prefix to use for the config entries |
References prefix.
|
inherited |
set the real position of the widget.
pos | if the mode is horizontal, only use top, bottom, if it is vertical use left or right |
References Digikam::DMultiTabBar::Private::internal, Digikam::DMultiTabBar::Private::position, and Digikam::DMultiTabBarFrame::setPosition().
Referenced by Digikam::DMultiTabBar::DMultiTabBar().
|
inherited |
Sets the depth used for state saving or loading.
depth | new depth to use |
|
inherited |
set the display style of the tabs
References Digikam::DMultiTabBar::Private::internal, and Digikam::DMultiTabBarFrame::setStyle().
Referenced by Digikam::DMultiTabBar::DMultiTabBar(), Sidebar(), Digikam::LightTableWindow::slotApplicationSettingsChanged(), and Digikam::ImageWindow::slotSetupChanged().
|
inherited |
set a tab to "raised"
id | The ID of the tab to manipulate |
state | true == activated/raised, false == not active |
References Digikam::DMultiTabBarTab::setState(), and Digikam::DMultiTabBar::tab().
Referenced by deleteTab(), and doLoadState().
void Digikam::Sidebar::shrink | ( | ) |
Hides the sidebar (display only the activation buttons)
References Digikam::Sidebar::Private::minimized, Digikam::Sidebar::Private::restoreSize, signalViewChanged(), Digikam::SidebarSplitter::size(), Digikam::Sidebar::Private::splitter, and Digikam::Sidebar::Private::stack.
Referenced by backup(), doLoadState(), Digikam::ItemIconView::toggleLeftSidebar(), and Digikam::ItemIconView::toggleRightSidebar().
|
signal |
Is emitted, when another tab is activated
Referenced by deleteTab(), doLoadState(), Digikam::ImportItemPropertiesSideBarImport::ImportItemPropertiesSideBarImport(), Digikam::ItemPropertiesSideBar::ItemPropertiesSideBar(), Digikam::ItemPropertiesSideBarDB::ItemPropertiesSideBarDB(), and setActiveTab().
|
signal |
Is emitted, when tab is shrink or expanded
Referenced by shrink().
SidebarSplitter * Digikam::Sidebar::splitter | ( | ) | const |
References Digikam::Sidebar::Private::splitter.
|
inherited |
get a pointer to a tab within the tab area, identified by its ID
References Digikam::DMultiTabBar::Private::internal, and Digikam::DMultiTabBarFrame::tab().
Referenced by activeNextTab(), activePreviousTab(), appendTab(), deleteTab(), doLoadState(), Digikam::DMultiTabBar::isTabRaised(), setActiveTab(), Digikam::DMultiTabBar::setTab(), and Digikam::ItemPropertiesSideBar::slotChangedTab().
|
inherited |
get the display style of the tabs
References Digikam::DMultiTabBar::Private::internal.
|
protectedinherited |
References Digikam::DMultiTabBar::Private::btnTabSep, and Digikam::DMultiTabBar::Private::buttons.
Referenced by Digikam::DMultiTabBarButton::hideEvent(), and Digikam::DMultiTabBarButton::showEvent().
|
friend |