author | zecke <zecke> | 2004-04-22 16:01:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-22 16:01:56 (UTC) |
commit | 53d6c4b8bfcb119635b26b78dee0ae4be8490b90 (patch) (side-by-side diff) | |
tree | a9aaecbe2e01b1bd5be2a1358e910e28dfdee906 | |
parent | 00977d309bc991ffb4a84216881b53432c6d0b47 (diff) | |
download | opie-53d6c4b8bfcb119635b26b78dee0ae4be8490b90.zip opie-53d6c4b8bfcb119635b26b78dee0ae4be8490b90.tar.gz opie-53d6c4b8bfcb119635b26b78dee0ae4be8490b90.tar.bz2 |
Fill the screen better on BigScreen
-rw-r--r-- | noncore/apps/oxygen/calcdlg.ui | 58 | ||||
-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 2 |
2 files changed, 40 insertions, 20 deletions
diff --git a/noncore/apps/oxygen/calcdlg.ui b/noncore/apps/oxygen/calcdlg.ui index 51bf334..60d312d 100644 --- a/noncore/apps/oxygen/calcdlg.ui +++ b/noncore/apps/oxygen/calcdlg.ui @@ -1,105 +1,121 @@ <!DOCTYPE UI><UI> <class>CalcDlg</class> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> <cstring>CalcDlg</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>237</width> - <height>318</height> + <width>323</width> + <height>380</height> </rect> </property> - <widget> + <property stdset="1"> + <name>caption</name> + <string>CalcDlg</string> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> + <grid> + <property stdset="1"> + <name>margin</name> + <number>-1</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>-1</number> + </property> + <widget row="0" column="0" > <class>QTabWidget</class> <property stdset="1"> <name>name</name> <cstring>TabWidget3</cstring> </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>240</width> - <height>320</height> - </rect> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> </property> <widget> <class>QWidget</class> <property stdset="1"> <name>name</name> <cstring>tab</cstring> </property> <attribute> <name>title</name> <string>Molecular Weight</string> </attribute> + <vbox> + <property stdset="1"> + <name>margin</name> + <number>-1</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>-1</number> + </property> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout6</cstring> </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>230</width> - <height>290</height> - </rect> - </property> <vbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel2</cstring> </property> <property stdset="1"> <name>text</name> <string>Chemical Formula</string> </property> </widget> <widget> <class>QLineEdit</class> <property stdset="1"> <name>name</name> <cstring>formula</cstring> </property> </widget> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> <cstring>Layout3</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> <widget> <class>QPushButton</class> <property stdset="1"> <name>name</name> <cstring>calculate</cstring> </property> @@ -118,52 +134,54 @@ <name>text</name> <string>Clear</string> </property> </widget> </hbox> </widget> <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel3</cstring> </property> <property stdset="1"> <name>text</name> <string>Molecular Weight (u):</string> </property> </widget> <widget> <class>QLineEdit</class> <property stdset="1"> <name>name</name> <cstring>result</cstring> </property> </widget> <widget> <class>QLabel</class> <property stdset="1"> <name>name</name> <cstring>TextLabel1</cstring> </property> <property stdset="1"> <name>text</name> <string>Elemental Composition (%):</string> </property> </widget> <widget> <class>QMultiLineEdit</class> <property stdset="1"> <name>name</name> <cstring>anal_display</cstring> </property> <property stdset="1"> <name>readOnly</name> <bool>true</bool> </property> </widget> </vbox> </widget> + </vbox> </widget> </widget> + </grid> </widget> </UI> diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index 48e2b20..798230a 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp @@ -52,96 +52,98 @@ void OxydataWidget::setElement( int el ) { QStringList::ConstIterator it = names.at(el); Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); configobj.setGroup( QString::number( el+1 )); left->setText( configobj.readEntry( "Symbol" ) ); middle->setText( *it ); right->setText( QString::number( el+1 ) ); DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) ); DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); DataTable->setText( 4,1,tr( "%1 pm" ).arg( configobj.readEntry( "AR" ) ) ) ; DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) ); DataTable->setText( 6,1,tr( "%1 g/cm^3" ).arg( configobj.readEntry( "Density" ) ) ); DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) ); DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) ); } void OxydataWidget::setTable() const { DataTable->setText( 0,0, tr( "Weight" ) ); DataTable->setText( 1,0, tr( "Block" )) ; DataTable->setText( 2,0, tr( "Group" )) ; DataTable->setText( 3,0, tr( "Electronegativity" )) ; DataTable->setText( 4,0, tr( "Atomic radius" )) ; DataTable->setText( 5,0, tr( "Ionization Energy" )) ; DataTable->setText( 6,0, tr( "Density" )) ; DataTable->setText( 7,0, tr( "Boiling point" ) ); DataTable->setText( 8,0, tr( "Melting point" ) ); } void OxydataWidget::setLayout() { #warning this is not working and I have no idea why! // DataTable->setColumnWidth ( 0 , this->width()/2 ); // DataTable->setColumnWidth ( 1 , this->width()/2 ); //X DataTable->setColumnWidth ( 0 , 110 ); //X DataTable->setColumnWidth ( 1 , 110 ); } OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, const char *name) : QTable(numRows, numCols,parent, name) { + setColumnStretchable( 0, true ); + setColumnStretchable( 1, true ); for (int zeile = 0; zeile < numRows; zeile++) for ( int spalte = 0; spalte < numCols; spalte++ ) { OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" ); setItem(zeile, spalte, (QTableItem*)testus); } this->setShowGrid( false ); this->setHScrollBarMode(QScrollView::AlwaysOff); this->horizontalHeader()->hide(); this->verticalHeader()->hide(); this->setTopMargin( 0 ); this->setLeftMargin( 0 ); } void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) { if ( cr.width() == 0 || cr.height() == 0 ) return; selected = FALSE; QTableItem *itm = item( row, col ); QColorGroup colgrp = colorGroup(); if ( itm ) { if ( row%2 ) colgrp.setColor( QColorGroup::Base, QColor( 180,200,210 ) ); else colgrp.setColor( QColorGroup::Base, QColor( 230,235,235 ) ); p->save(); itm->paint( p, colgrp, cr, selected ); p->restore(); } } OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text ) : QTableItem ( table, et, text ) { } int OxydataQTI::alignment() const { if ( col()%2 ) { return AlignRight | AlignVCenter; }else return AlignLeft | AlignVCenter; |