tabs vs. spaces: the eternal struggle
This commit is contained in:
		
							parent
							
								
									ebe4968175
								
							
						
					
					
						commit
						403e5b4328
					
				@ -81,7 +81,7 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow()
 | 
			
		||||
  ui_vp_wtce = new AOMovie(this, ao_app);
 | 
			
		||||
  ui_vp_objection = new AOMovie(this, ao_app);
 | 
			
		||||
 | 
			
		||||
	ui_ic_chatlog = new QTextEdit(this);
 | 
			
		||||
  ui_ic_chatlog = new QTextEdit(this);
 | 
			
		||||
  ui_ic_chatlog->setReadOnly(true);
 | 
			
		||||
 | 
			
		||||
  ui_ms_chatlog = new AOTextArea(this);
 | 
			
		||||
@ -964,7 +964,7 @@ void Courtroom::handle_chatmessage(QStringList *p_contents)
 | 
			
		||||
    ui_evidence_present->set_image("present_disabled.png");
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
	append_ic_text(": " + m_chatmessage[MESSAGE], f_showname);
 | 
			
		||||
  append_ic_text(": " + m_chatmessage[MESSAGE], f_showname);
 | 
			
		||||
 | 
			
		||||
  previous_ic_message = f_message;
 | 
			
		||||
 | 
			
		||||
@ -1150,18 +1150,18 @@ void Courtroom::handle_chatmessage_3()
 | 
			
		||||
 | 
			
		||||
void Courtroom::append_ic_text(QString p_text, QString p_name)
 | 
			
		||||
{
 | 
			
		||||
	QTextCharFormat bold;
 | 
			
		||||
	QTextCharFormat normal;
 | 
			
		||||
	bold.setFontWeight(QFont::Bold);
 | 
			
		||||
	normal.setFontWeight(QFont::Normal);
 | 
			
		||||
  QTextCharFormat bold;
 | 
			
		||||
  QTextCharFormat normal;
 | 
			
		||||
  bold.setFontWeight(QFont::Bold);
 | 
			
		||||
  normal.setFontWeight(QFont::Normal);
 | 
			
		||||
  const QTextCursor old_cursor = ui_ic_chatlog->textCursor();
 | 
			
		||||
  const int old_scrollbar_value = ui_ic_chatlog->verticalScrollBar()->value();
 | 
			
		||||
  const bool is_scrolled_up = old_scrollbar_value == ui_ic_chatlog->verticalScrollBar()->minimum();
 | 
			
		||||
 | 
			
		||||
	ui_ic_chatlog->moveCursor(QTextCursor::Start);
 | 
			
		||||
  ui_ic_chatlog->moveCursor(QTextCursor::Start);
 | 
			
		||||
 | 
			
		||||
	ui_ic_chatlog->textCursor().insertText(p_name, bold);
 | 
			
		||||
	ui_ic_chatlog->textCursor().insertText(p_text + '\n', normal);
 | 
			
		||||
  ui_ic_chatlog->textCursor().insertText(p_name, bold);
 | 
			
		||||
  ui_ic_chatlog->textCursor().insertText(p_text + '\n', normal);
 | 
			
		||||
 | 
			
		||||
  if (old_cursor.hasSelection() || !is_scrolled_up)
 | 
			
		||||
  {
 | 
			
		||||
@ -1531,7 +1531,7 @@ void Courtroom::handle_song(QStringList *p_contents)
 | 
			
		||||
 | 
			
		||||
    if (!mute_map.value(n_char))
 | 
			
		||||
    {
 | 
			
		||||
			append_ic_text(" has played a song: " + f_song, str_char);
 | 
			
		||||
      append_ic_text(" has played a song: " + f_song, str_char);
 | 
			
		||||
      music_player->play(f_song);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user