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

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

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

@ -496,11 +496,18 @@ void PresentationWidget::generateOverlay()
QImage image( doublePixmap.convertToImage().smoothScale( side, side ) ); QImage image( doublePixmap.convertToImage().smoothScale( side, side ) );
image.setAlphaBuffer( true ); image.setAlphaBuffer( true );
// generate a monochrome pixmap using grey level as alpha channel // generate a monochrome pixmap using grey level as alpha channel and
int pixels = image.width() * image.height(); // 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 int * data = (unsigned int *)image.bits();
unsigned char alpha;
for( int i = 0; i < pixels; ++i ) 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 ); m_lastRenderedOverlay.convertFromImage( image );
// start the autohide timer // start the autohide timer

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

Loading…
Cancel
Save