Added option to unlink thumbnailslist from pageview (oneliner). Fixuifiles.

Use palette->active->hilight color for wheel in presentation mode, since
black over black was hard to recognize. Fixes.

svn path=/trunk/kdegraphics/kpdf/; revision=377198
remotes/origin/kpdf-3.4
Enrico Ros 21 years ago
parent 3bf154b57d
commit 10af2d6caa
  1. 37
      conf/dlggeneral.ui
  2. 3
      conf/dlgpresentation.ui
  3. 5
      conf/kpdf.kcfg
  4. 13
      ui/presentationwidget.cpp
  5. 15
      ui/thumbnaillist.cpp

@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>320</width>
<height>143</height>
<height>169</height>
</rect>
</property>
<vbox>
@ -32,7 +32,7 @@
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout9</cstring>
<cstring>layout6</cstring>
</property>
<vbox>
<property name="name">
@ -48,13 +48,24 @@
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout1</cstring>
<cstring>layout5</cstring>
</property>
<hbox>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<spacer>
<widget class="QCheckBox" row="0" column="1">
<property name="name">
<cstring>kcfg_ShowSearchBar</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Show &amp;search bar in thumbnails list</string>
</property>
</widget>
<spacer row="0" column="0" rowspan="2" colspan="1">
<property name="name">
<cstring>spacer2</cstring>
</property>
@ -67,22 +78,22 @@
<property name="sizeHint">
<size>
<width>16</width>
<height>20</height>
<height>30</height>
</size>
</property>
</spacer>
<widget class="QCheckBox">
<widget class="QCheckBox" row="1" column="1">
<property name="name">
<cstring>kcfg_ShowSearchBar</cstring>
<cstring>kcfg_SyncThumbnailsViewport</cstring>
</property>
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Show &amp;search bar in thumbnails list</string>
<string>Link &amp;thumbnails list with the page</string>
</property>
</widget>
</hbox>
</grid>
</widget>
<widget class="QCheckBox">
<property name="name">
@ -173,6 +184,12 @@
<receiver>kcfg_ShowSearchBar</receiver>
<slot>setEnabled(bool)</slot>
</connection>
<connection>
<sender>kcfg_ShowLeftPanel</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_SyncThumbnailsViewport</receiver>
<slot>setEnabled(bool)</slot>
</connection>
</connections>
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>

@ -12,9 +12,6 @@
<height>261</height>
</rect>
</property>
<property name="caption">
<string>DlgPresentation</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>

@ -75,6 +75,11 @@
<max>8</max>
</entry>
</group>
<group name="ThumbnailsList" >
<entry key="SyncThumbnailsViewport" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="Performance" >
<entry key="MemoryLevel" type="Enum" >
<default>Normal</default>

@ -496,11 +496,18 @@ void PresentationWidget::generateOverlay()
QImage image( doublePixmap.convertToImage().smoothScale( side, side ) );
image.setAlphaBuffer( true );
// generate a monochrome pixmap using grey level as alpha channel
int pixels = image.width() * image.height();
// generate a monochrome pixmap using grey level as alpha channel and
// a saturated hilight color as base color
int hue, sat, val;
palette().active().highlight().getHsv( &hue, &sat, &val );
sat = (sat + 255) / 2;
const QColor & color = QColor( hue, sat, val, QColor::Hsv );
int red = color.red(), green = color.green(), blue = color.blue(),
pixels = image.width() * image.height();
unsigned int * data = (unsigned int *)image.bits();
unsigned char alpha;
for( int i = 0; i < pixels; ++i )
data[i] = qRgba( 0, 0, 0, data[i] & 0xFF ); // base color can be changed here
data[i] = qRgba( red, green, blue, data[i] & 0xFF );
m_lastRenderedOverlay.convertFromImage( image );
// start the autohide timer

@ -134,23 +134,30 @@ void ThumbnailList::notifySetup( const QValueVector< KPDFPage * > & pages, bool
void ThumbnailList::notifyViewportChanged()
{
// skip notifies for the current page (already selected)
int newPage = m_document->viewport().pageNumber;
if ( m_selected && m_selected->pageNumber() == newPage )
return;
// deselect previous thumbnail
if ( m_selected )
m_selected->setSelected( false );
m_selected = 0;
// select the page with viewport and ensure it's centered in the view
int pageNumber = m_document->viewport().pageNumber;
m_vectorIndex = 0;
QValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
for ( ; tIt != tEnd; ++tIt )
{
if ( (*tIt)->pageNumber() == pageNumber )
if ( (*tIt)->pageNumber() == newPage )
{
m_selected = *tIt;
m_selected->setSelected( true );
ensureVisible( 0, childY( m_selected ) + m_selected->height()/2, 0, visibleHeight()/2 );
//non-centered version: ensureVisible( 0, itemTop + itemHeight/2, 0, itemHeight/2 );
if ( Settings::syncThumbnailsViewport() )
{
int yOffset = QMAX( visibleHeight() / 4, m_selected->height() / 2 );
ensureVisible( 0, childY( m_selected ) + m_selected->height()/2, 0, yOffset );
}
break;
}
m_vectorIndex++;

Loading…
Cancel
Save