author | alwin <alwin> | 2005-04-10 15:08:36 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-04-10 15:08:36 (UTC) |
commit | a6670730bf0b36b243303e581c4a80d29851c12b (patch) (side-by-side diff) | |
tree | ee32e2014def6e99315292d48daa9ae8661797c3 | |
parent | 7a49d0610ae9bc1cadacf9d572c671009cb3c088 (diff) | |
download | opie-a6670730bf0b36b243303e581c4a80d29851c12b.zip opie-a6670730bf0b36b243303e581c4a80d29851c12b.tar.gz opie-a6670730bf0b36b243303e581c4a80d29851c12b.tar.bz2 |
using big icons on small screens makes no sense. Half of screen will
just used by unsharp icons - not a good idea. Now it depends on desktopsize
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index f3e7501..a30bd8b 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp @@ -275,144 +275,145 @@ QString OFileSelectorItem::directory()const { return m_dir; } bool OFileSelectorItem::isDir()const { return m_isDir; } QString OFileSelectorItem::path()const { return text( 1 ); } QString OFileSelectorItem::key( int id, bool )const { QString ke; /* * id = 0 ||id == 1 : Sort By Name but Directories at Top * id = 2 : Sort By Size: Prepend '0' to the key */ if( id == 0 || id == 1 ) { // name if( m_isDir ) { ke.append("0" ); ke.append( text(1) ); } else { ke.append("1" ); ke.append( text(1) ); } return ke; }else if(id == 2) { return text(2).rightJustify(20, '0'); }else return text( id ); } OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& startDir, OFileSelector* sel) :QWidget( parent ), m_sel( sel ) { m_all = false; QVBoxLayout* lay = new QVBoxLayout( this ); m_currentDir = startDir; + bool bigicons = qApp->desktop()->size().width()>330; /* * now we add a special bar * One Button For Up * Home * Doc * And a dropdown menu with FileSystems * FUTURE: one to change dir with lineedit * Bookmarks * Create Dir */ QHBox* box = new QHBox(this ); box->setBackgroundMode( PaletteButton ); box->setSpacing( 0 ); QToolButton *btn = new QToolButton( box ); - btn->setUsesBigPixmap( true ); + btn->setUsesBigPixmap(bigicons); btn->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); connect(btn, SIGNAL(clicked() ), this, SLOT( cdUP() ) ); btn = new QToolButton( box ); - btn->setUsesBigPixmap( true ); + btn->setUsesBigPixmap(bigicons); btn->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) ); connect(btn, SIGNAL(clicked() ), this, SLOT( cdHome() ) ); btn = new QToolButton( box ); - btn->setUsesBigPixmap( true ); + btn->setUsesBigPixmap(bigicons); btn->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) ); connect(btn, SIGNAL(clicked() ), this, SLOT(cdDoc() ) ); m_btnNew = new QToolButton( box ); - m_btnNew->setUsesBigPixmap( true ); + m_btnNew->setUsesBigPixmap(bigicons); m_btnNew->setPixmap( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ) ); connect(m_btnNew, SIGNAL(clicked() ), this, SLOT(slotNew() ) ); m_btnClose = new QToolButton( box ); - m_btnClose->setUsesBigPixmap( true ); + m_btnClose->setUsesBigPixmap(bigicons); m_btnClose->setPixmap( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) ); connect(m_btnClose, SIGNAL(clicked() ), selector(), SIGNAL(closeMe() ) ); btn = new QToolButton( box ); - btn->setUsesBigPixmap( true ); + btn->setUsesBigPixmap(bigicons); btn->setPixmap( Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ) ); m_fsButton = btn; /* let's fill device parts */ QPopupMenu* pop = new QPopupMenu(this); connect(pop, SIGNAL( activated(int) ), this, SLOT(slotFSActivated(int) ) ); StorageInfo storage; const QList<FileSystem> &fs = storage.fileSystems(); QListIterator<FileSystem> it(fs); for ( ; it.current(); ++it ) { const QString disk = (*it)->name(); const QString path = (*it)->path(); m_dev.insert( disk, path ); pop->insertItem( disk ); } m_fsPop = pop; connect(btn,SIGNAL(pressed()),this,SLOT(slotFSpressed())); lay->addWidget( box ); m_view = new QListView( this ); m_view->installEventFilter(this); QPEApplication::setStylusOperation( m_view->viewport(), QPEApplication::RightOnHold); m_view->addColumn(" " ); m_view->addColumn(tr("Name"), 135 ); m_view->addColumn(tr("Size"), -1 ); m_view->addColumn(tr("Date"), 60 ); m_view->addColumn(tr("Mime Type"), -1 ); m_view->setSorting( 1 ); m_view->setAllColumnsShowFocus( TRUE ); lay->addWidget( m_view, 1000 ); connectSlots(); } void OFileViewFileListView::slotFSpressed() { m_fsPop->exec(QPoint( QCursor::pos().x(), QCursor::pos().y())); m_fsButton->setDown(false); |