-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateview.cpp b/noncore/apps/tinykate/libkate/view/kateview.cpp index c5673a5..b9ebb1a 100644 --- a/noncore/apps/tinykate/libkate/view/kateview.cpp +++ b/noncore/apps/tinykate/libkate/view/kateview.cpp | |||
@@ -2281,129 +2281,130 @@ void KateView::configDialog() | |||
2281 | colorConfig->setColors(colors); | 2281 | colorConfig->setColors(colors); |
2282 | 2282 | ||
2283 | page = kd->addPage(i18n("Fonts")); | 2283 | page = kd->addPage(i18n("Fonts")); |
2284 | (new QVBoxLayout(page))->setAutoAdd(true); | 2284 | (new QVBoxLayout(page))->setAutoAdd(true); |
2285 | 2285 | ||
2286 | FontConfig *fontConfig = new FontConfig(page); | 2286 | FontConfig *fontConfig = new FontConfig(page); |
2287 | fontConfig->setFont (myDoc->getFont()); | 2287 | fontConfig->setFont (myDoc->getFont()); |
2288 | 2288 | ||
2289 | // indent options | 2289 | // indent options |
2290 | page=kd->addPage(i18n("Indent")); | 2290 | page=kd->addPage(i18n("Indent")); |
2291 | (new QVBoxLayout(page))->setAutoAdd(true); | 2291 | (new QVBoxLayout(page))->setAutoAdd(true); |
2292 | 2292 | ||
2293 | IndentConfigTab *indentConfig = new IndentConfigTab(page, this); | 2293 | IndentConfigTab *indentConfig = new IndentConfigTab(page, this); |
2294 | 2294 | ||
2295 | // select options | 2295 | // select options |
2296 | page=kd->addPage(i18n("Select")); | 2296 | page=kd->addPage(i18n("Select")); |
2297 | (new QVBoxLayout(page))->setAutoAdd(true); | 2297 | (new QVBoxLayout(page))->setAutoAdd(true); |
2298 | 2298 | ||
2299 | SelectConfigTab *selectConfig = new SelectConfigTab(page, this); | 2299 | SelectConfigTab *selectConfig = new SelectConfigTab(page, this); |
2300 | 2300 | ||
2301 | // edit options | 2301 | // edit options |
2302 | page=kd->addPage(i18n("Edit")); | 2302 | page=kd->addPage(i18n("Edit")); |
2303 | (new QVBoxLayout(page))->setAutoAdd(true); | 2303 | (new QVBoxLayout(page))->setAutoAdd(true); |
2304 | 2304 | ||
2305 | EditConfigTab *editConfig = new EditConfigTab(page, this); | 2305 | EditConfigTab *editConfig = new EditConfigTab(page, this); |
2306 | 2306 | ||
2307 | 2307 | ||
2308 | 2308 | ||
2309 | HighlightDialogPage *hlPage; | 2309 | HighlightDialogPage *hlPage; |
2310 | HlManager *hlManager; | 2310 | HlManager *hlManager; |
2311 | HlDataList hlDataList; | 2311 | HlDataList hlDataList; |
2312 | ItemStyleList defaultStyleList; | 2312 | ItemStyleList defaultStyleList; |
2313 | 2313 | ||
2314 | hlManager = HlManager::self(); | 2314 | hlManager = HlManager::self(); |
2315 | 2315 | ||
2316 | defaultStyleList.setAutoDelete(true); | 2316 | defaultStyleList.setAutoDelete(true); |
2317 | hlManager->getDefaults(defaultStyleList); | 2317 | hlManager->getDefaults(defaultStyleList); |
2318 | 2318 | ||
2319 | hlDataList.setAutoDelete(true); | 2319 | hlDataList.setAutoDelete(true); |
2320 | //this gets the data from the KateConfig object | 2320 | //this gets the data from the KateConfig object |
2321 | hlManager->getHlDataList(hlDataList); | 2321 | hlManager->getHlDataList(hlDataList); |
2322 | 2322 | ||
2323 | page=kd->addPage(i18n("Highlighting")); | 2323 | page=kd->addPage(i18n("Highlighting")); |
2324 | (new QVBoxLayout(page))->setAutoAdd(true); | 2324 | (new QVBoxLayout(page))->setAutoAdd(true); |
2325 | 2325 | ||
2326 | hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page); | 2326 | hlPage = new HighlightDialogPage(hlManager, &defaultStyleList, &hlDataList, 0, page); |
2327 | if ( QPEApplication::execDialog( kd )) { | 2327 | if ( QPEApplication::execDialog( kd )) { |
2328 | // color options | 2328 | // color options |
2329 | colorConfig->getColors(colors); | 2329 | colorConfig->getColors(colors); |
2330 | myDoc->setFont (fontConfig->getFont()); | 2330 | myDoc->setFont (fontConfig->getFont()); |
2331 | 2331 | ||
2332 | applyColors(); | 2332 | applyColors(); |
2333 | // indent options | 2333 | // indent options |
2334 | indentConfig->getData(this); | 2334 | indentConfig->getData(this); |
2335 | // select options | 2335 | // select options |
2336 | selectConfig->getData(this); | 2336 | selectConfig->getData(this); |
2337 | // edit options | 2337 | // edit options |
2338 | editConfig->getData(this); | 2338 | editConfig->getData(this); |
2339 | // spell checker | 2339 | // spell checker |
2340 | hlManager->setHlDataList(hlDataList); | 2340 | hlManager->setHlDataList(hlDataList); |
2341 | hlManager->setDefaults(defaultStyleList); | 2341 | hlManager->setDefaults(defaultStyleList); |
2342 | hlPage->saveData(); | 2342 | hlPage->saveData(); |
2343 | } | 2343 | } |
2344 | 2344 | ||
2345 | // delete kd; | 2345 | qApp->processEvents(); |
2346 | delete kd; | ||
2346 | 2347 | ||
2347 | #endif | 2348 | #endif |
2348 | } | 2349 | } |
2349 | 2350 | ||
2350 | int KateView::getHl() { | 2351 | int KateView::getHl() { |
2351 | return myDoc->highlightNum(); | 2352 | return myDoc->highlightNum(); |
2352 | } | 2353 | } |
2353 | 2354 | ||
2354 | void KateView::setDontChangeHlOnSave() | 2355 | void KateView::setDontChangeHlOnSave() |
2355 | { | 2356 | { |
2356 | myDoc->setDontChangeHlOnSave(); | 2357 | myDoc->setDontChangeHlOnSave(); |
2357 | } | 2358 | } |
2358 | 2359 | ||
2359 | void KateView::setHl(int n) { | 2360 | void KateView::setHl(int n) { |
2360 | myDoc->setHighlight(n); | 2361 | myDoc->setHighlight(n); |
2361 | myDoc->setDontChangeHlOnSave(); | 2362 | myDoc->setDontChangeHlOnSave(); |
2362 | myDoc->updateViews(); | 2363 | myDoc->updateViews(); |
2363 | } | 2364 | } |
2364 | 2365 | ||
2365 | int KateView::getEol() { | 2366 | int KateView::getEol() { |
2366 | return myDoc->eolMode; | 2367 | return myDoc->eolMode; |
2367 | } | 2368 | } |
2368 | 2369 | ||
2369 | void KateView::setEol(int eol) { | 2370 | void KateView::setEol(int eol) { |
2370 | if (isReadOnly()) | 2371 | if (isReadOnly()) |
2371 | return; | 2372 | return; |
2372 | 2373 | ||
2373 | myDoc->eolMode = eol; | 2374 | myDoc->eolMode = eol; |
2374 | myDoc->setModified(true); | 2375 | myDoc->setModified(true); |
2375 | } | 2376 | } |
2376 | 2377 | ||
2377 | 2378 | ||
2378 | 2379 | ||
2379 | void KateView::paintEvent(QPaintEvent *e) { | 2380 | void KateView::paintEvent(QPaintEvent *e) { |
2380 | int x, y; | 2381 | int x, y; |
2381 | 2382 | ||
2382 | QRect updateR = e->rect(); // update rectangle | 2383 | QRect updateR = e->rect(); // update rectangle |
2383 | // debug("Update rect = ( %i, %i, %i, %i )", | 2384 | // debug("Update rect = ( %i, %i, %i, %i )", |
2384 | // updateR.x(),updateR.y(), updateR.width(), updateR.height() ); | 2385 | // updateR.x(),updateR.y(), updateR.width(), updateR.height() ); |
2385 | 2386 | ||
2386 | int ux1 = updateR.x(); | 2387 | int ux1 = updateR.x(); |
2387 | int uy1 = updateR.y(); | 2388 | int uy1 = updateR.y(); |
2388 | int ux2 = ux1 + updateR.width(); | 2389 | int ux2 = ux1 + updateR.width(); |
2389 | int uy2 = uy1 + updateR.height(); | 2390 | int uy2 = uy1 + updateR.height(); |
2390 | 2391 | ||
2391 | QPainter paint; | 2392 | QPainter paint; |
2392 | paint.begin(this); | 2393 | paint.begin(this); |
2393 | 2394 | ||
2394 | QColorGroup g = colorGroup(); | 2395 | QColorGroup g = colorGroup(); |
2395 | x = width(); | 2396 | x = width(); |
2396 | y = height(); | 2397 | y = height(); |
2397 | 2398 | ||
2398 | paint.setPen(g.dark()); | 2399 | paint.setPen(g.dark()); |
2399 | if (uy1 <= 0) paint.drawLine(0,0,x-2,0); | 2400 | if (uy1 <= 0) paint.drawLine(0,0,x-2,0); |
2400 | if (ux1 <= 0) paint.drawLine(0,1,0,y-2); | 2401 | if (ux1 <= 0) paint.drawLine(0,1,0,y-2); |
2401 | 2402 | ||
2402 | paint.setPen(black); | 2403 | paint.setPen(black); |
2403 | if (uy1 <= 1) paint.drawLine(1,1,x-3,1); | 2404 | if (uy1 <= 1) paint.drawLine(1,1,x-3,1); |
2404 | if (ux1 <= 1) paint.drawLine(1,2,1,y-3); | 2405 | if (ux1 <= 1) paint.drawLine(1,2,1,y-3); |
2405 | 2406 | ||
2406 | paint.setPen(g.midlight()); | 2407 | paint.setPen(g.midlight()); |
2407 | if (uy2 >= y-1) paint.drawLine(1,y-2,x-3,y-2); | 2408 | if (uy2 >= y-1) paint.drawLine(1,y-2,x-3,y-2); |
2408 | if (ux2 >= x-1) paint.drawLine(x-2,1,x-2,y-2); | 2409 | if (ux2 >= x-1) paint.drawLine(x-2,1,x-2,y-2); |
2409 | 2410 | ||