mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
PDFViewer: Add a tab bar with outlines and thumbnails
Outlines are in theory implemented (though I'm having trouble finding a simple PDF with outlines to test it on), and thumbnails are not.
This commit is contained in:
parent
67b65dffa8
commit
cea7dbce42
7 changed files with 250 additions and 7 deletions
31
Userland/Applications/PDFViewer/SidebarWidget.cpp
Normal file
31
Userland/Applications/PDFViewer/SidebarWidget.cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Matthew Olsson <mattco@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "SidebarWidget.h"
|
||||
#include <LibGUI/BoxLayout.h>
|
||||
#include <LibGUI/TabWidget.h>
|
||||
|
||||
SidebarWidget::SidebarWidget()
|
||||
{
|
||||
set_fill_with_background_color(true);
|
||||
set_layout<GUI::VerticalBoxLayout>();
|
||||
set_enabled(false);
|
||||
|
||||
auto& tab_bar = add<GUI::TabWidget>();
|
||||
|
||||
auto& outline_container = tab_bar.add_tab<GUI::Widget>("Outline");
|
||||
outline_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
outline_container.layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
||||
m_outline_tree_view = outline_container.add<GUI::TreeView>();
|
||||
m_outline_tree_view->set_activates_on_selection(true);
|
||||
|
||||
auto& thumbnails_container = tab_bar.add_tab<GUI::Widget>("Thumbnails");
|
||||
thumbnails_container.set_layout<GUI::VerticalBoxLayout>();
|
||||
thumbnails_container.layout()->set_margins({ 4, 4, 4, 4 });
|
||||
|
||||
// FIXME: Add thumbnail previews
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue