namespace lyx {
-using lyx::support::libFileSearch;
+using support::libFileSearch;
using std::string;
{
setupUi(this);
- for (int iter = 0; iter < 4; ++iter) {
+ for (int iter = 0; iter < 4; ++iter)
bullets_[iter] = ITEMIZE_DEFAULTS[iter];
- }
+
current_font_ = -1;
current_char_ = 0;
setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 3"), "psnfss3");
setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 4"), "psnfss4");
- Q_CONNECT_1(QListWidget, levelLW, currentRowChanged, int,
- BulletsModule, this, showLevel,int);
-
- Q_CONNECT_1(QComboBox, bulletpaneCO, activated, int,
- QStackedWidget, bulletpaneSW, setCurrentIndex, int);
-}
-
-
-BulletsModule::~BulletsModule()
-{
+ connect(levelLW, SIGNAL(currentRowChanged(int)),
+ this, SLOT(showLevel(int)));
+ connect(bulletpaneCO, SIGNAL(activated(int)), bulletpaneSW,
+ SLOT(setCurrentIndex(int)));
}
-void BulletsModule::setupPanel(QListWidget * lw, QString panelname, std::string fname)
+void BulletsModule::setupPanel(QListWidget * lw, QString const & panelname,
+ std::string const & fname)
{
- Q_CONNECT_2(QListWidget, lw, currentItemChanged, QListWidgetItem*, QListWidgetItem*,
- BulletsModule, this, bulletSelected, QListWidgetItem*, QListWidgetItem*);
+ connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),
+ this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*)));
// add panelname to combox
bulletpaneCO->addItem(panelname);
// get pixmap with bullets
QPixmap pixmap = QPixmap(toqstr(libFileSearch("images", fname, "xpm").absFilename()));
+
int const w = pixmap.width() / 6;
int const h = pixmap.height() / 6;
lw->setFlow(QListView::LeftToRight);
lw->setMovement(QListView::Static);
lw->setUniformItemSizes(true);
- lw->setGridSize( QSize(w , h) );
- lw->resize( 6 * w + 6 , 6 * h);
- bulletpaneSW->setMinimumSize( 6 * w + 6 , 6 * h);
+ lw->setGridSize(QSize(w, h));
+ // the widening by 21 is needed to avoid wrapping
+ lw->resize(6 * w + 21, 6 * h);
+ bulletpaneSW->setMinimumSize(6 * w, 6 * h + 6);
// get individual bullets from pixmap
for (int row = 0; row < 6; ++row) {
}
-void BulletsModule::on_customCB_toggled(bool custom)
+void BulletsModule::on_customCB_clicked(bool custom)
{
if (!custom) {
if (current_font_ < 0)
return bullets_[level];
}
-
} // namespace lyx
#include "BulletsModule_moc.cpp"
-